aboutsummaryrefslogtreecommitdiff
path: root/c
diff options
context:
space:
mode:
authorJohn Ankarström <john@ankarstrom.se>2022-07-14 13:27:06 +0200
committerJohn Ankarström <john@ankarstrom.se>2022-07-14 13:27:06 +0200
commitfa4eaa3d572a9bb2bebbf9da15c7e8445a10dfc1 (patch)
treef28b5eb543a9f22075d0bdaf8d32c3948d11d4b3 /c
parent9fa048519fab2a75613857243748e7a061ef9844 (diff)
downloadEpisodeBrowser-fa4eaa3d572a9bb2bebbf9da15c7e8445a10dfc1.tar.gz
Pass WM_DESTROY to ListView::WndProc.
On WM_DESTROY, the "this" property was removed before it could be retrieved and dereferenced, making it impossible for WM_DESTROY messages to be passed to the WndProc method.
Diffstat (limited to 'c')
-rw-r--r--c/listview.cpp8
1 files changed, 3 insertions, 5 deletions
diff --git a/c/listview.cpp b/c/listview.cpp
index b375454..f38b952 100644
--- a/c/listview.cpp
+++ b/c/listview.cpp
@@ -96,12 +96,10 @@ ListView::WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
LRESULT CALLBACK
WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
- switch (uMsg) {
- case WM_DESTROY:
+ ListView *lpLv = (ListView *)GetProp(hWnd, TEXT("this"));
+
+ if (uMsg == WM_DESTROY)
RemoveProp(hWnd, TEXT("this"));
- break;
- }
- ListView *lpLv = (ListView *)GetProp(hWnd, TEXT("this"));
return lpLv? lpLv->WndProc(hWnd, uMsg, wParam, lParam): FALSE;
}