diff --git a/src/msw/cursor.cpp b/src/msw/cursor.cpp index 4cea893b6b..f9f6167d68 100644 --- a/src/msw/cursor.cpp +++ b/src/msw/cursor.cpp @@ -67,8 +67,13 @@ wxCursorRefData::wxCursorRefData() void wxCursorRefData::Free() { - if ( m_hCursor && m_destroyCursor ) - ::DestroyCursor((HCURSOR)m_hCursor); + if ( m_hCursor ) + { + if ( m_destroyCursor ) + ::DestroyCursor((HCURSOR)m_hCursor); + + m_hCursor = 0; + } } // ---------------------------------------------------------------------------- diff --git a/src/msw/icon.cpp b/src/msw/icon.cpp index 0c2187db94..1ca4dafb12 100644 --- a/src/msw/icon.cpp +++ b/src/msw/icon.cpp @@ -62,7 +62,11 @@ void wxIconRefData::Free() { if ( m_hIcon ) + { ::DestroyIcon((HICON) m_hIcon); + + m_hIcon = 0; + } } // ----------------------------------------------------------------------------