commit 557c2911fccb5433a5e18c73785bddf4473f1033
parent 587af37621d3c734ba6ac1770e08005047bcdab0
Author: cfillion <cfillion@users.noreply.github.com>
Date: Sat, 25 Jun 2016 23:23:29 -0400
dialog: better fix for onClose after close()
from ~Dialog/DestroyWindow we cannot call the reimplementation from the subclasses
Diffstat:
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/src/dialog.cpp b/src/dialog.cpp
@@ -142,9 +142,9 @@ Dialog::~Dialog()
for(Control *control : m_controls | boost::adaptors::map_values)
delete control;
- DestroyWindow(m_handle);
-
s_instances.erase(m_handle);
+
+ DestroyWindow(m_handle);
}
INT_PTR Dialog::init(REAPER_PLUGIN_HINSTANCE inst, HWND parent, Modality mode)
@@ -190,6 +190,7 @@ void Dialog::close(const INT_PTR result)
EndDialog(m_handle, result);
break;
case Modeless:
+ SendMessage(m_handle, WM_DESTROY, 0, (LPARAM)this);
m_closeHandler(result);
break;
}