From f3aeb2bdd72a84d0893a49cfb0798d1d0080a1a4 Mon Sep 17 00:00:00 2001 From: Courtney Goeltzenleuchter Date: Tue, 21 Apr 2015 09:30:03 -0600 Subject: demos: remove mem references before destroying Need to do the staging texture destroy after removing references to avoid referencing freed memory. --- demos/cube.c | 2 +- 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"); -- cgit v1.2.3