X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/350ba193e5bde0368edb8d354ac0ac092158f3ce..b40e227882bdf5e13fc9dde605348d4a1c1e8c60:/src/msw/spinctrl.cpp diff --git a/src/msw/spinctrl.cpp b/src/msw/spinctrl.cpp index e4cef9f9ac..dbf5cdceef 100644 --- a/src/msw/spinctrl.cpp +++ b/src/msw/spinctrl.cpp @@ -40,7 +40,7 @@ #include "wx/spinctrl.h" #include "wx/msw/private.h" -#if defined(__WIN95__) && !(defined(__GNUWIN32_OLD__) || defined(__TWIN32__)) +#if defined(__WIN95__) && !((defined(__GNUWIN32_OLD__) || defined(__TWIN32__)) && !defined(__CYGWIN10__)) #include #endif @@ -85,9 +85,12 @@ LRESULT APIENTRY _EXPORT wxBuddyTextWndProc(HWND hwnd, { wxSpinCtrl *spin = (wxSpinCtrl *)::GetWindowLong(hwnd, GWL_USERDATA); - // forward some messages (the key ones only so far) to the spin ctrl + // forward some messages (the key and focus ones only so far) to + // the spin ctrl switch ( message ) { + case WM_SETFOCUS: + case WM_KILLFOCUS: case WM_CHAR: case WM_DEADCHAR: case WM_KEYUP: @@ -317,6 +320,10 @@ wxSpinCtrl::~wxSpinCtrl() { ms_allSpins.Remove(this); + // This removes spurious memory leak reporting + if (ms_allSpins.GetCount() == 0) + ms_allSpins.Clear(); + // destroy the buddy window because this pointer which wxBuddyTextWndProc // uses will not soon be valid any more ::DestroyWindow(GetBuddyHwnd());