Fix wxMSW wxComboCtrl build with pre-C++11 compilers

Replace a lambda used in c445798fa8 (Fix using wxComboCtrl popup inside
AUI floating panes, 2023-03-31) with a separate function.
This commit is contained in:
Vadim Zeitlin 2023-07-24 17:57:22 +02:00
parent 4b52a36801
commit 056023cd3a

View File

@ -374,21 +374,22 @@ protected:
// We can't delete it immediately because this object is used after
// this function returns, so do it slightly later.
wxWindow* const self = this;
m_combo->CallAfter([self]()
{
// Before really deleting it, reset the HWND which had been
// already destroyed, to prevent us from trying to destroy it
// again (which would just fail with an error).
self->DissociateHandle();
delete self;
});
m_combo->CallAfter(&wxComboPopupWindow::DeleteSelf);
}
return wxComboPopupWindowBase::MSWHandleMessage(result, message,
wParam, lParam);
}
void DeleteSelf()
{
// Before really deleting it, reset the HWND which had been
// already destroyed, to prevent us from trying to destroy it
// again (which would just fail with an error).
DissociateHandle();
delete this;
}
#endif // __WXMSW__
private: