summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/mir_core/src/Windows/CCtrlBase.cpp10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/mir_core/src/Windows/CCtrlBase.cpp b/src/mir_core/src/Windows/CCtrlBase.cpp
index ad80ccffe7..f9ac6413e0 100644
--- a/src/mir_core/src/Windows/CCtrlBase.cpp
+++ b/src/mir_core/src/Windows/CCtrlBase.cpp
@@ -52,12 +52,10 @@ void CCtrlBase::OnInit()
void CCtrlBase::OnDestroy()
{
- PVOID bullshit[2]; // vfptr + hwnd
- bullshit[1] = m_hwnd;
- CCtrlBase *pCtrl = arControls.find((CCtrlBase*)&bullshit);
- if (pCtrl) {
- pCtrl->Unsubclass();
- arControls.remove(pCtrl);
+ int idx = arControls.indexOf(this);
+ if (idx != -1) {
+ Unsubclass();
+ arControls.remove(idx);
}
m_hwnd = nullptr;