From: Stefan Csomor Date: Sat, 5 Jan 2002 16:39:22 +0000 (+0000) Subject: memory leak fixed X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/12cd5f34e72ba5e6e295936d2a74b9080552a331 memory leak fixed git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@13386 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/mac/app.cpp b/src/mac/app.cpp index b16dcd492a..0f813f16ab 100644 --- a/src/mac/app.cpp +++ b/src/mac/app.cpp @@ -56,9 +56,6 @@ #if wxUSE_SOCKETS #ifdef __DARWIN__ #include - #else - #include - #include #endif #endif @@ -526,6 +523,7 @@ bool wxApp::Initialize() void wxApp::CleanUp() { + wxToolTip::RemoveToolTips() ; #if wxUSE_LOG // flush the logged messages if any and install a 'safer' log target: the // default one (wxLogGui) can't be used after the resources are freed just @@ -563,6 +561,9 @@ void wxApp::CleanUp() if (wxWinMacWindowList) delete wxWinMacWindowList ; + if (wxWinMacControlList) + delete wxWinMacControlList ; + delete wxPendingEvents; #if wxUSE_THREADS delete wxPendingEventsLocker; diff --git a/src/mac/carbon/app.cpp b/src/mac/carbon/app.cpp index b16dcd492a..0f813f16ab 100644 --- a/src/mac/carbon/app.cpp +++ b/src/mac/carbon/app.cpp @@ -56,9 +56,6 @@ #if wxUSE_SOCKETS #ifdef __DARWIN__ #include - #else - #include - #include #endif #endif @@ -526,6 +523,7 @@ bool wxApp::Initialize() void wxApp::CleanUp() { + wxToolTip::RemoveToolTips() ; #if wxUSE_LOG // flush the logged messages if any and install a 'safer' log target: the // default one (wxLogGui) can't be used after the resources are freed just @@ -563,6 +561,9 @@ void wxApp::CleanUp() if (wxWinMacWindowList) delete wxWinMacWindowList ; + if (wxWinMacControlList) + delete wxWinMacControlList ; + delete wxPendingEvents; #if wxUSE_THREADS delete wxPendingEventsLocker; diff --git a/src/mac/carbon/tooltip.cpp b/src/mac/carbon/tooltip.cpp index 0655699087..5ddf8b92e2 100644 --- a/src/mac/carbon/tooltip.cpp +++ b/src/mac/carbon/tooltip.cpp @@ -55,15 +55,15 @@ class wxMacToolTip class wxMacToolTipTimer : wxTimer { public: + wxMacToolTipTimer() {} ; wxMacToolTipTimer(wxMacToolTip* tip, int iMilliseconds) ; - + virtual ~wxMacToolTipTimer() {} ; void Notify() { if ( m_mark == m_tip->GetMark() ) m_tip->Draw() ; } - protected: wxMacToolTip* m_tip; long m_mark ; @@ -187,7 +187,7 @@ void wxMacToolTip::Setup( WindowRef window , wxString text , wxPoint localPosit { m_mark++ ; Clear() ; - m_position = localPosition ; + m_position = localPosition ; m_label = wxMacMakeMacStringFromPC( text ) ; m_window = window ; s_ToolTipWindowRef = window ; @@ -323,6 +323,11 @@ void wxToolTip::NotifyWindowDelete( WXHWND win ) void wxMacToolTip::Clear() { m_mark++ ; + if ( m_timer ) + { + delete m_timer ; + m_timer = NULL ; + } if ( !m_shown ) return ; diff --git a/src/mac/tooltip.cpp b/src/mac/tooltip.cpp index 0655699087..5ddf8b92e2 100644 --- a/src/mac/tooltip.cpp +++ b/src/mac/tooltip.cpp @@ -55,15 +55,15 @@ class wxMacToolTip class wxMacToolTipTimer : wxTimer { public: + wxMacToolTipTimer() {} ; wxMacToolTipTimer(wxMacToolTip* tip, int iMilliseconds) ; - + virtual ~wxMacToolTipTimer() {} ; void Notify() { if ( m_mark == m_tip->GetMark() ) m_tip->Draw() ; } - protected: wxMacToolTip* m_tip; long m_mark ; @@ -187,7 +187,7 @@ void wxMacToolTip::Setup( WindowRef window , wxString text , wxPoint localPosit { m_mark++ ; Clear() ; - m_position = localPosition ; + m_position = localPosition ; m_label = wxMacMakeMacStringFromPC( text ) ; m_window = window ; s_ToolTipWindowRef = window ; @@ -323,6 +323,11 @@ void wxToolTip::NotifyWindowDelete( WXHWND win ) void wxMacToolTip::Clear() { m_mark++ ; + if ( m_timer ) + { + delete m_timer ; + m_timer = NULL ; + } if ( !m_shown ) return ;