mirror of
https://github.com/godotengine/godot.git
synced 2024-11-27 09:16:35 +08:00
Fixes leaks in ResourceCache, Vulkan and X11
This commit is contained in:
parent
84142f6a5f
commit
943ec79859
@ -477,6 +477,9 @@ void ResourceCache::clear() {
|
||||
|
||||
resources.clear();
|
||||
memdelete(lock);
|
||||
#ifdef TOOLS_ENABLED
|
||||
memdelete(path_cache_lock);
|
||||
#endif
|
||||
}
|
||||
|
||||
void ResourceCache::reload_externals() {
|
||||
|
@ -7274,6 +7274,11 @@ void RenderingDeviceVulkan::finalize() {
|
||||
vertex_formats.erase(temp);
|
||||
}
|
||||
|
||||
for (int i = 0; i < framebuffer_formats.size(); i++) {
|
||||
vkDestroyRenderPass(device, framebuffer_formats[i].render_pass, nullptr);
|
||||
}
|
||||
framebuffer_formats.clear();
|
||||
|
||||
//all these should be clear at this point
|
||||
ERR_FAIL_COND(descriptor_pools.size());
|
||||
ERR_FAIL_COND(dependency_map.size());
|
||||
|
@ -1503,6 +1503,15 @@ VulkanContext::~VulkanContext() {
|
||||
if (queue_props) {
|
||||
free(queue_props);
|
||||
}
|
||||
for (uint32_t i = 0; i < FRAME_LAG; i++) {
|
||||
vkDestroyFence(device, fences[i], nullptr);
|
||||
vkDestroySemaphore(device, image_acquired_semaphores[i], nullptr);
|
||||
vkDestroySemaphore(device, draw_complete_semaphores[i], nullptr);
|
||||
if (separate_present_queue) {
|
||||
vkDestroySemaphore(device, image_ownership_semaphores[i], nullptr);
|
||||
}
|
||||
}
|
||||
DestroyDebugUtilsMessengerEXT(inst, dbg_messenger, nullptr);
|
||||
vkDestroyDevice(device, nullptr);
|
||||
vkDestroyInstance(inst, nullptr);
|
||||
}
|
||||
|
@ -1471,9 +1471,12 @@ DisplayServer::WindowMode DisplayServerX11::window_get_mode(WindowID p_window) c
|
||||
|
||||
if (result == Success && data) {
|
||||
long *state = (long *)data;
|
||||
if (state[0] == WM_IconicState)
|
||||
if (state[0] == WM_IconicState) {
|
||||
XFree(data);
|
||||
return WINDOW_MODE_MINIMIZED;
|
||||
}
|
||||
XFree(data);
|
||||
}
|
||||
}
|
||||
|
||||
// all other discarded, return windowed.
|
||||
|
Loading…
Reference in New Issue
Block a user