Destroy correct HWND in wxMSW wxSpinCtrl::Reparent().
NULL HWND was passed to ::DestroyWindow() as wxWindow::UnsubclassWin() NULLed it after unsubclassing. See #12633. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65965 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
parent
053e42428d
commit
bc73fe96a2
@ -604,9 +604,11 @@ bool wxSpinCtrl::Reparent(wxWindowBase *newParent)
|
|||||||
int value = GetValue();
|
int value = GetValue();
|
||||||
const wxRect btnRect = wxRectFromRECT(wxGetWindowRect(GetHwnd()));
|
const wxRect btnRect = wxRectFromRECT(wxGetWindowRect(GetHwnd()));
|
||||||
|
|
||||||
// destroy the old spin button
|
// destroy the old spin button after detaching it from this wxWindow object
|
||||||
|
// (notice that m_hWnd will be reset by UnsubclassWin() so save it first)
|
||||||
|
const HWND hwndOld = GetHwnd();
|
||||||
UnsubclassWin();
|
UnsubclassWin();
|
||||||
if ( !::DestroyWindow(GetHwnd()) )
|
if ( !::DestroyWindow(hwndOld) )
|
||||||
{
|
{
|
||||||
wxLogLastError(wxT("DestroyWindow"));
|
wxLogLastError(wxT("DestroyWindow"));
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user