зеркало из https://github.com/mozilla/gecko-dev.git
fix memory leaks (nsMacMessage sink). r=pavlov, bug=15380
This commit is contained in:
Родитель
3427de714a
Коммит
70619021e6
|
@ -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__
|
||||
|
|
Загрузка…
Ссылка в новой задаче