diff options
author | GuidoRevers <39414297+GuidoRevers@users.noreply.github.com> | 2020-05-21 18:39:28 +0200 |
---|---|---|
committer | GuidoRevers <39414297+GuidoRevers@users.noreply.github.com> | 2020-05-21 20:38:58 +0200 |
commit | cf20c0343fe19c5d26e0904c64e3d99f3d9448e3 (patch) | |
tree | ec723a39a2b8e343772cd2a524b7cbe7a63889d6 | |
parent | 9239412027b6c25009efab69dc39650e0d76c56d (diff) |
Fix segmentation fault when using context_vulkan after memdelete context_vulkan
-rw-r--r-- | platform/windows/display_server_windows.cpp | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/platform/windows/display_server_windows.cpp b/platform/windows/display_server_windows.cpp index 30a3ad5a01..85acdababc 100644 --- a/platform/windows/display_server_windows.cpp +++ b/platform/windows/display_server_windows.cpp @@ -3074,18 +3074,6 @@ DisplayServerWindows::~DisplayServerWindows() { cursors_cache.clear(); -#if defined(VULKAN_ENABLED) - if (rendering_driver == "vulkan") { - if (rendering_device_vulkan) { - rendering_device_vulkan->finalize(); - memdelete(rendering_device_vulkan); - } - - if (context_vulkan) - memdelete(context_vulkan); - } -#endif - if (user_proc) { SetWindowLongPtr(windows[MAIN_WINDOW_ID].hWnd, GWLP_WNDPROC, (LONG_PTR)user_proc); }; @@ -3102,4 +3090,16 @@ DisplayServerWindows::~DisplayServerWindows() { } DestroyWindow(windows[MAIN_WINDOW_ID].hWnd); } + +#if defined(VULKAN_ENABLED) + if (rendering_driver == "vulkan") { + if (rendering_device_vulkan) { + rendering_device_vulkan->finalize(); + memdelete(rendering_device_vulkan); + } + + if (context_vulkan) + memdelete(context_vulkan); + } +#endif } |