From 49ff1af16a51c60b9f9b40fce296ca852f5064da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Thu, 28 Dec 2023 10:44:08 +0100 Subject: [PATCH] CtrlDisplayListView: Zero the window ptr, do the delete. See #18510 --- Windows/GEDebugger/CtrlDisplayListView.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Windows/GEDebugger/CtrlDisplayListView.cpp b/Windows/GEDebugger/CtrlDisplayListView.cpp index 7318beb808..2d9e64239d 100644 --- a/Windows/GEDebugger/CtrlDisplayListView.cpp +++ b/Windows/GEDebugger/CtrlDisplayListView.cpp @@ -77,8 +77,7 @@ LRESULT CALLBACK CtrlDisplayListView::wndProc(HWND hwnd, UINT msg, WPARAM wParam { CtrlDisplayListView *win = CtrlDisplayListView::getFrom(hwnd); - switch(msg) - { + switch(msg) { case WM_NCCREATE: // Allocate a new CustCtrl structure for this window. win = new CtrlDisplayListView(hwnd); @@ -86,6 +85,8 @@ LRESULT CALLBACK CtrlDisplayListView::wndProc(HWND hwnd, UINT msg, WPARAM wParam // Continue with window creation. return win != NULL; case WM_NCDESTROY: + SetWindowLongPtr(hwnd, GWLP_USERDATA, 0); + delete win; break; case WM_SIZE: win->redraw();