commit b8c636a94a419184ceeded01f2ded70e9a452311
parent 1e22ef697c7777c5deb994e00d3114d1ccf473d7
Author: cfillion <cfillion@users.noreply.github.com>
Date: Sat, 25 Jun 2016 17:34:01 -0400
dialog: fix onClose being called after the controls are destroyed on windows
this change got lost somehow in the git history...
Diffstat:
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/src/dialog.cpp b/src/dialog.cpp
@@ -77,6 +77,12 @@ WDL_DLGRET Dialog::Proc(HWND handle, UINT msg, WPARAM wParam, LPARAM lParam)
case WM_CONTEXTMENU:
dlg->onContextMenu((HWND)wParam, LOWORD(lParam), HIWORD(lParam));
break;
+ case WM_DESTROY:
+ if(dlg->isVisible())
+ dlg->onHide();
+
+ dlg->onClose();
+ break;
};
return false;
@@ -153,11 +159,6 @@ INT_PTR Dialog::init(REAPER_PLUGIN_HINSTANCE inst, HWND parent, Modality mode)
void Dialog::Destroy(Dialog *dlg)
{
- if(dlg->isVisible())
- dlg->onHide();
-
- dlg->onClose();
-
delete dlg;
}