diff options
| author | Courtney Goeltzenleuchter <courtney@LunarG.com> | 2015-04-21 09:30:03 -0600 |
|---|---|---|
| committer | Courtney Goeltzenleuchter <courtney@LunarG.com> | 2015-04-22 10:48:24 -0600 |
| commit | f3aeb2bdd72a84d0893a49cfb0798d1d0080a1a4 (patch) | |
| tree | fc1060a35b1d12a7fc09e66cc6209d227e2d67a4 | |
| parent | 0600115afb68012bf20a3e75fdb7302776d59666 (diff) | |
| download | usermoji-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.c | 2 | ||||
| -rw-r--r-- | demos/tri.c | 2 |
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"); |
