When all command buffers allocated from a given pool are not used any more, and we also don't need the pool, we can safely destroy it.
Destroying a command pool
How to do it...
- Take the handle of a logical device and store it in a variable of type VkDevice named logical_device.
- Use a handle of the pool that should be destroyed to initialize a variable of type VkCommandPool named command_pool.
- Call vkDestroyCommandPool( logical_device, command_pool, nullptr ), for which provide the handles of the logical device and the command pool, and a nullptr value.
- For safety reasons, assign the VK_NULL_HANDLE value to the command_pool variable.