mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-02 01:48:05 +00:00
bug 210713: [gtk2] leaks in nsWindow and nsAppShell.
r+sr=blizzard.
This commit is contained in:
parent
bfc281cacf
commit
2d360fcd0c
@ -96,6 +96,19 @@ nsAppShell::~nsAppShell(void)
|
||||
{
|
||||
}
|
||||
|
||||
/* static */ void
|
||||
nsAppShell::ReleaseGlobals()
|
||||
{
|
||||
if (sQueueHashTable) {
|
||||
PL_HashTableDestroy(sQueueHashTable);
|
||||
sQueueHashTable = nsnull;
|
||||
}
|
||||
if (sCountHashTable) {
|
||||
PL_HashTableDestroy(sCountHashTable);
|
||||
sCountHashTable = nsnull;
|
||||
}
|
||||
}
|
||||
|
||||
NS_IMPL_ISUPPORTS1(nsAppShell, nsIAppShell)
|
||||
|
||||
NS_IMETHODIMP
|
||||
|
@ -49,6 +49,8 @@ public:
|
||||
nsAppShell();
|
||||
virtual ~nsAppShell();
|
||||
|
||||
static void ReleaseGlobals();
|
||||
|
||||
NS_DECL_ISUPPORTS
|
||||
NS_DECL_NSIAPPSHELL
|
||||
|
||||
|
@ -119,6 +119,8 @@ static const nsModuleComponentInfo components[] =
|
||||
PR_STATIC_CALLBACK(void)
|
||||
nsWidgetGtk2ModuleDtor(nsIModule *aSelf)
|
||||
{
|
||||
nsWindow::ReleaseGlobals();
|
||||
nsAppShell::ReleaseGlobals();
|
||||
}
|
||||
|
||||
NS_IMPL_NSGETMODULE_WITH_DTOR(nsWidgetGtk2Module,
|
||||
|
@ -218,6 +218,8 @@ static GtkIMContext *IM_get_input_context(MozDrawingarea *aArea);
|
||||
// cursor cache
|
||||
GdkCursor *gCursorCache[eCursorCount];
|
||||
|
||||
#define ARRAY_LENGTH(a) (sizeof(a)/sizeof(a[0]))
|
||||
|
||||
nsWindow::nsWindow()
|
||||
{
|
||||
mContainer = nsnull;
|
||||
@ -273,6 +275,17 @@ nsWindow::~nsWindow()
|
||||
Destroy();
|
||||
}
|
||||
|
||||
/* static */ void
|
||||
nsWindow::ReleaseGlobals()
|
||||
{
|
||||
for (PRUint32 i = 0; i < ARRAY_LENGTH(gCursorCache); ++i) {
|
||||
if (gCursorCache[i]) {
|
||||
gdk_cursor_unref(gCursorCache[i]);
|
||||
gCursorCache[i] = nsnull;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
NS_IMPL_ISUPPORTS_INHERITED1(nsWindow, nsCommonWidget,
|
||||
nsISupportsWeakReference)
|
||||
|
||||
|
@ -67,6 +67,8 @@ public:
|
||||
nsWindow();
|
||||
virtual ~nsWindow();
|
||||
|
||||
static void ReleaseGlobals();
|
||||
|
||||
NS_DECL_ISUPPORTS_INHERITED
|
||||
|
||||
// nsIWidget
|
||||
|
Loading…
Reference in New Issue
Block a user