Bug 626602, part 8.1: Close the XDisplay to free the gfxXlibSurface DisplayTable, for the sake of leak checkers. r=karlt

This commit is contained in:
Chris Jones 2011-02-08 18:44:14 -06:00
parent c593a45834
commit e25c495c5c
2 changed files with 24 additions and 8 deletions

View File

@ -137,14 +137,9 @@ PluginModuleChild::~PluginModuleChild()
if (mLibrary) {
PR_UnloadLibrary(mLibrary);
}
#ifdef MOZ_WIDGET_QT
nsQAppInstance::Release();
if (sGtkLib) {
PR_UnloadLibrary(sGtkLib);
sGtkLib = nsnull;
s_gtk_init = nsnull;
}
#endif
DeinitGraphics();
gInstance = nsnull;
}
@ -559,6 +554,26 @@ PluginModuleChild::InitGraphics()
return true;
}
void
PluginModuleChild::DeinitGraphics()
{
#ifdef MOZ_WIDGET_QT
nsQAppInstance::Release();
if (sGtkLib) {
PR_UnloadLibrary(sGtkLib);
sGtkLib = nsnull;
s_gtk_init = nsnull;
}
#endif
#if defined(MOZ_X11) && defined(NS_FREE_PERMANENT_DATA)
// We free some data off of XDisplay close hooks, ensure they're
// run. Closing the display is pretty scary, so we only do it to
// silence leak checkers.
XCloseDisplay(DefaultXDisplay());
#endif
}
bool
PluginModuleChild::AnswerNP_Shutdown(NPError *rv)
{

View File

@ -261,6 +261,7 @@ public:
private:
void InitQuirksModes(const nsCString& aMimeType);
bool InitGraphics();
void DeinitGraphics();
#if defined(MOZ_WIDGET_GTK2)
static gboolean DetectNestedEventLoop(gpointer data);
static gboolean ProcessBrowserEvents(gpointer data);