aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCourtney Goeltzenleuchter <courtney@LunarG.com>2015-04-21 09:30:03 -0600
committerCourtney Goeltzenleuchter <courtney@LunarG.com>2015-04-22 10:48:24 -0600
commitf3aeb2bdd72a84d0893a49cfb0798d1d0080a1a4 (patch)
treefc1060a35b1d12a7fc09e66cc6209d227e2d67a4
parent0600115afb68012bf20a3e75fdb7302776d59666 (diff)
downloadusermoji-f3aeb2bdd72a84d0893a49cfb0798d1d0080a1a4.tar.xz
demos: remove mem references before destroying
Need to do the staging texture destroy after removing references to avoid referencing freed memory.
-rw-r--r--demos/cube.c2
-rw-r--r--demos/tri.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/demos/cube.c b/demos/cube.c
index 75b537aa..79aefccd 100644
--- a/demos/cube.c
+++ b/demos/cube.c
@@ -1003,8 +1003,8 @@ static void demo_prepare_textures(struct demo *demo)
demo_flush_init_cmd(demo);
- demo_destroy_texture_image(demo, &staging_texture);
demo_remove_mem_refs(demo, staging_texture.num_mem, staging_texture.mem);
+ demo_destroy_texture_image(demo, &staging_texture);
} else {
/* Can't support VK_FORMAT_B8G8R8A8_UNORM !? */
assert(!"No support for tB8G8R8A8_UNORM as texture image format");
diff --git a/demos/tri.c b/demos/tri.c
index 0621e3b3..2bcf6e0e 100644
--- a/demos/tri.c
+++ b/demos/tri.c
@@ -665,8 +665,8 @@ static void demo_prepare_textures(struct demo *demo)
demo_flush_init_cmd(demo);
- demo_destroy_texture_image(demo, &staging_texture);
demo_remove_mem_refs(demo, staging_texture.num_mem, staging_texture.mem);
+ demo_destroy_texture_image(demo, &staging_texture);
} else {
/* Can't support VK_FORMAT_B8G8R8A8_UNORM !? */
assert(!"No support for B8G8R8A8_UNORM as texture image format");