diff --git a/include/wx/msw/statbmp.h b/include/wx/msw/statbmp.h index 990483d06a..1e88548995 100644 --- a/include/wx/msw/statbmp.h +++ b/include/wx/msw/statbmp.h @@ -90,9 +90,6 @@ private: // HICON (which can be 0) and destroy the previous image if necessary. void MSWReplaceImageHandle(WXLPARAM handle); - // Delete the current handle only if we own it. - void DeleteCurrentHandleIfNeeded(); - wxDECLARE_DYNAMIC_CLASS(wxStaticBitmap); wxDECLARE_EVENT_TABLE(); diff --git a/src/msw/statbmp.cpp b/src/msw/statbmp.cpp index 29cacc6b5c..4c6d7cc2a1 100644 --- a/src/msw/statbmp.cpp +++ b/src/msw/statbmp.cpp @@ -191,20 +191,15 @@ void wxStaticBitmap::Init() m_ownsCurrentHandle = false; } -void wxStaticBitmap::DeleteCurrentHandleIfNeeded() +void wxStaticBitmap::Free() { + MSWReplaceImageHandle(0); + if ( m_ownsCurrentHandle ) { ::DeleteObject(m_currentHandle); m_ownsCurrentHandle = false; } -} - -void wxStaticBitmap::Free() -{ - MSWReplaceImageHandle(0); - - DeleteCurrentHandleIfNeeded(); wxDELETE(m_image); }