fix memory leaks (nsMacMessage sink). r=pavlov, bug=15380

This commit is contained in:
beard%netscape.com 1999-10-09 03:08:56 +00:00
Родитель 3427de714a
Коммит 70619021e6
2 изменённых файлов: 11 добавлений и 18 удалений

Просмотреть файл

@ -74,11 +74,9 @@ NS_IMETHODIMP nsAppShell::SetDispatchListener(nsDispatchListener* aDispatchListe
NS_IMETHODIMP nsAppShell::Create(int* argc, char ** argv)
{
mToolKit = auto_ptr<nsToolkit>( new nsToolkit() );
mMacSink = new nsMacMessageSink();
mMacPump = auto_ptr<nsMacMessagePump>( new nsMacMessagePump(mToolKit.get(), mMacSink) );
return NS_OK;
mMacSink = auto_ptr<nsMacMessageSink>( new nsMacMessageSink() );
mMacPump = auto_ptr<nsMacMessagePump>( new nsMacMessagePump(mToolKit.get(), mMacSink.get()) );
return NS_OK;
}
//-------------------------------------------------------------------------
@ -169,7 +167,6 @@ nsAppShell::nsAppShell()
}
mRefCnt = 0;
mExitCalled = PR_FALSE;
mMacSink = 0;
}
//-------------------------------------------------------------------------

Просмотреть файл

@ -39,18 +39,6 @@ class nsToolkit;
class nsAppShell : public nsIAppShell
{
private:
nsDispatchListener *mDispatchListener; // note: we don't own this, but it can be NULL
auto_ptr<nsToolkit> mToolKit;
auto_ptr<nsMacMessagePump> mMacPump;
nsMacMessageSink *mMacSink; //¥¥¥ this will be COM, so use scc's COM_auto_ptr
PRBool mExitCalled;
static PRBool mInitializedToolbox;
// CLASS METHODS
private:
public:
nsAppShell();
virtual ~nsAppShell();
@ -72,6 +60,14 @@ class nsAppShell : public nsIAppShell
NS_IMETHOD DispatchNativeEvent(PRBool aRealEvent, void *aEvent);
NS_IMETHOD EventIsForModalWindow(PRBool aRealEvent, void *aEvent, nsIWidget *aWidget,
PRBool *aForWindow);
private:
nsDispatchListener *mDispatchListener; // note: we don't own this, but it can be NULL
auto_ptr<nsToolkit> mToolKit;
auto_ptr<nsMacMessagePump> mMacPump;
auto_ptr<nsMacMessageSink> mMacSink; //¥¥¥ this will be COM, so use scc's COM_auto_ptr
PRBool mExitCalled;
static PRBool mInitializedToolbox;
};
#endif // nsAppShell_h__