0
votes

In an android native application, when I call:

vkDestroyDevice( vk.device, VK_ALLOCATOR )

I've got error Error: [Validation] Code 614466292 X object 0xffffffffd3bcb900 has not been destroyed (...).

But I have called vkDestroy(Object) for each of the objects. (image, imageview, pipeline, etc)

Here is one object creation / destruction:

static void create_shader_module(const unsigned char* pBytes, const int count, VkShaderModule* pVkShaderMod) {
    VkShaderModuleCreateInfo desc;
    desc.sType = VK_STRUCTURE_TYPE_SHADER_MODULE_CREATE_INFO;
    desc.pNext = NULL;
    desc.flags = 0;
    desc.codeSize = count;
    desc.pCode = (const uint32_t*)pBytes;          
    VK(vkCreateShaderModule(vk.device, &desc, NULL, pVkShaderMod));
}
extern unsigned char multiview_single_texture_vert_spv[];
extern int multiview_single_texture_vert_spv_size;
create_shader_module(multiview_single_texture_vert_spv, multiview_single_texture_vert_spv_size, &s_gShaderModules.single_texture_vs);

And for the destruction part:

vkDestroyShaderModule(vk.device, s_gShaderModules.single_texture_vs, NULL);

When I call vkDestroyShaderModule, vk.device is still active, and I 've got no error. But as soon as I call vkDestroyDevice(), I've got error:

OBJ ERROR : For device 0xeb0ac330, ShaderModule object 0xffffffffeb0c6240 has not been destroyed. The spec valid usage text states 'All child objects created on device must have been destroyed prior to destroying device'

Freeing the struct memory with memset(&s_gShaderModules, 0, sizeof(s_gShaderModules)); does not solve the problem.

The error is on an android device, unfortunaly I can't test the application on another device. Everything else in the application works, I even destruct and recreate some of the objects at runtime without error, except the application crash on exit.

1

1 Answers

0
votes

I've just removed the validation layers, and surprisingly the application no longer crashes, the closing sequence ends successfully. Why didn't I try it earlier? The problem only occurs with layers, it may be due to their order in the extension array.