memory leak fixed

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@13386 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Stefan Csomor
2002-01-05 16:39:22 +00:00
parent 9c152f8094
commit 12cd5f34e7
4 changed files with 24 additions and 12 deletions

View File

@@ -56,9 +56,6 @@
#if wxUSE_SOCKETS #if wxUSE_SOCKETS
#ifdef __DARWIN__ #ifdef __DARWIN__
#include <CoreServices/CoreServices.h> #include <CoreServices/CoreServices.h>
#else
#include <OpenTransport.h>
#include <OpenTptInternet.h>
#endif #endif
#endif #endif
@@ -526,6 +523,7 @@ bool wxApp::Initialize()
void wxApp::CleanUp() void wxApp::CleanUp()
{ {
wxToolTip::RemoveToolTips() ;
#if wxUSE_LOG #if wxUSE_LOG
// flush the logged messages if any and install a 'safer' log target: the // 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 // default one (wxLogGui) can't be used after the resources are freed just
@@ -563,6 +561,9 @@ void wxApp::CleanUp()
if (wxWinMacWindowList) if (wxWinMacWindowList)
delete wxWinMacWindowList ; delete wxWinMacWindowList ;
if (wxWinMacControlList)
delete wxWinMacControlList ;
delete wxPendingEvents; delete wxPendingEvents;
#if wxUSE_THREADS #if wxUSE_THREADS
delete wxPendingEventsLocker; delete wxPendingEventsLocker;

View File

@@ -56,9 +56,6 @@
#if wxUSE_SOCKETS #if wxUSE_SOCKETS
#ifdef __DARWIN__ #ifdef __DARWIN__
#include <CoreServices/CoreServices.h> #include <CoreServices/CoreServices.h>
#else
#include <OpenTransport.h>
#include <OpenTptInternet.h>
#endif #endif
#endif #endif
@@ -526,6 +523,7 @@ bool wxApp::Initialize()
void wxApp::CleanUp() void wxApp::CleanUp()
{ {
wxToolTip::RemoveToolTips() ;
#if wxUSE_LOG #if wxUSE_LOG
// flush the logged messages if any and install a 'safer' log target: the // 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 // default one (wxLogGui) can't be used after the resources are freed just
@@ -563,6 +561,9 @@ void wxApp::CleanUp()
if (wxWinMacWindowList) if (wxWinMacWindowList)
delete wxWinMacWindowList ; delete wxWinMacWindowList ;
if (wxWinMacControlList)
delete wxWinMacControlList ;
delete wxPendingEvents; delete wxPendingEvents;
#if wxUSE_THREADS #if wxUSE_THREADS
delete wxPendingEventsLocker; delete wxPendingEventsLocker;

View File

@@ -55,15 +55,15 @@ class wxMacToolTip
class wxMacToolTipTimer : wxTimer class wxMacToolTipTimer : wxTimer
{ {
public: public:
wxMacToolTipTimer() {} ;
wxMacToolTipTimer(wxMacToolTip* tip, int iMilliseconds) ; wxMacToolTipTimer(wxMacToolTip* tip, int iMilliseconds) ;
virtual ~wxMacToolTipTimer() {} ;
void Notify() void Notify()
{ {
if ( m_mark == m_tip->GetMark() ) if ( m_mark == m_tip->GetMark() )
m_tip->Draw() ; m_tip->Draw() ;
} }
protected: protected:
wxMacToolTip* m_tip; wxMacToolTip* m_tip;
long m_mark ; long m_mark ;
@@ -187,7 +187,7 @@ void wxMacToolTip::Setup( WindowRef window , wxString text , wxPoint localPosit
{ {
m_mark++ ; m_mark++ ;
Clear() ; Clear() ;
m_position = localPosition ; m_position = localPosition ;
m_label = wxMacMakeMacStringFromPC( text ) ; m_label = wxMacMakeMacStringFromPC( text ) ;
m_window = window ; m_window = window ;
s_ToolTipWindowRef = window ; s_ToolTipWindowRef = window ;
@@ -323,6 +323,11 @@ void wxToolTip::NotifyWindowDelete( WXHWND win )
void wxMacToolTip::Clear() void wxMacToolTip::Clear()
{ {
m_mark++ ; m_mark++ ;
if ( m_timer )
{
delete m_timer ;
m_timer = NULL ;
}
if ( !m_shown ) if ( !m_shown )
return ; return ;

View File

@@ -55,15 +55,15 @@ class wxMacToolTip
class wxMacToolTipTimer : wxTimer class wxMacToolTipTimer : wxTimer
{ {
public: public:
wxMacToolTipTimer() {} ;
wxMacToolTipTimer(wxMacToolTip* tip, int iMilliseconds) ; wxMacToolTipTimer(wxMacToolTip* tip, int iMilliseconds) ;
virtual ~wxMacToolTipTimer() {} ;
void Notify() void Notify()
{ {
if ( m_mark == m_tip->GetMark() ) if ( m_mark == m_tip->GetMark() )
m_tip->Draw() ; m_tip->Draw() ;
} }
protected: protected:
wxMacToolTip* m_tip; wxMacToolTip* m_tip;
long m_mark ; long m_mark ;
@@ -187,7 +187,7 @@ void wxMacToolTip::Setup( WindowRef window , wxString text , wxPoint localPosit
{ {
m_mark++ ; m_mark++ ;
Clear() ; Clear() ;
m_position = localPosition ; m_position = localPosition ;
m_label = wxMacMakeMacStringFromPC( text ) ; m_label = wxMacMakeMacStringFromPC( text ) ;
m_window = window ; m_window = window ;
s_ToolTipWindowRef = window ; s_ToolTipWindowRef = window ;
@@ -323,6 +323,11 @@ void wxToolTip::NotifyWindowDelete( WXHWND win )
void wxMacToolTip::Clear() void wxMacToolTip::Clear()
{ {
m_mark++ ; m_mark++ ;
if ( m_timer )
{
delete m_timer ;
m_timer = NULL ;
}
if ( !m_shown ) if ( !m_shown )
return ; return ;