diff --git a/mozilla/accessible/src/atk/nsAppRootAccessible.cpp b/mozilla/accessible/src/atk/nsAppRootAccessible.cpp index e62774bbbaf..846ea0f5e22 100644 --- a/mozilla/accessible/src/atk/nsAppRootAccessible.cpp +++ b/mozilla/accessible/src/atk/nsAppRootAccessible.cpp @@ -51,6 +51,7 @@ typedef GType (* AtkGetTypeType) (void); GType g_atk_hyperlink_impl_type = G_TYPE_INVALID; static PRBool sATKChecked = PR_FALSE; +static PRLibrary *sATKLib = nsnull; static PRBool sInitialized = PR_FALSE; static const char sATKLibName[] = "libatk-1.0.so.0"; static const char sATKHyperlinkImplGetTypeSymbol[] = "atk_hyperlink_impl_get_type"; @@ -567,6 +568,7 @@ NS_IMETHODIMP nsAppRootAccessible::Init() // an exit function registered will take care of it // if (sAtkBridge.shutdown) // (*sAtkBridge.shutdown)(); + PR_UnloadLibrary(sAtkBridge.lib); sAtkBridge.lib = NULL; sAtkBridge.init = NULL; sAtkBridge.shutdown = NULL; @@ -577,10 +579,15 @@ NS_IMETHODIMP nsAppRootAccessible::Init() // 2) We need it to avoid assert in spi_atk_tidy_windows // if (sGail.shutdown) // (*sGail.shutdown)(); + PR_UnloadLibrary(sGail.lib); sGail.lib = NULL; sGail.init = NULL; sGail.shutdown = NULL; } + if (sATKLib) { + PR_UnloadLibrary(sATKLib); + sATKLib = nsnull; + } } NS_IMETHODIMP nsAppRootAccessible::GetName(nsAString& _retval) @@ -820,9 +827,9 @@ nsAppRootAccessible * nsAppRootAccessible::Create() { if (!sATKChecked) { - PRLibrary *atkLib = PR_LoadLibrary(sATKLibName); - if (atkLib) { - AtkGetTypeType pfn_atk_hyperlink_impl_get_type = (AtkGetTypeType) PR_FindFunctionSymbol(atkLib, sATKHyperlinkImplGetTypeSymbol); + sATKLib = PR_LoadLibrary(sATKLibName); + if (sATKLib) { + AtkGetTypeType pfn_atk_hyperlink_impl_get_type = (AtkGetTypeType) PR_FindFunctionSymbol(sATKLib, sATKHyperlinkImplGetTypeSymbol); if (pfn_atk_hyperlink_impl_get_type) { g_atk_hyperlink_impl_type = pfn_atk_hyperlink_impl_get_type(); } diff --git a/mozilla/extensions/auth/nsAuthFactory.cpp b/mozilla/extensions/auth/nsAuthFactory.cpp index 71705e5f6ab..711f26980fb 100644 --- a/mozilla/extensions/auth/nsAuthFactory.cpp +++ b/mozilla/extensions/auth/nsAuthFactory.cpp @@ -270,4 +270,11 @@ InitNegotiateAuth(nsIModule *self) #define InitNegotiateAuth nsnull #endif -NS_IMPL_NSGETMODULE_WITH_CTOR(nsAuthModule, components, InitNegotiateAuth) +PR_STATIC_CALLBACK(void) +DestroyNegotiateAuth(nsIModule *self) +{ + nsAuthGSSAPI::Shutdown(); +} + +NS_IMPL_NSGETMODULE_WITH_CTOR_DTOR(nsAuthModule, components, + InitNegotiateAuth, DestroyNegotiateAuth) diff --git a/mozilla/extensions/auth/nsAuthGSSAPI.cpp b/mozilla/extensions/auth/nsAuthGSSAPI.cpp index c4e28a98244..ae310cc3053 100644 --- a/mozilla/extensions/auth/nsAuthGSSAPI.cpp +++ b/mozilla/extensions/auth/nsAuthGSSAPI.cpp @@ -103,7 +103,7 @@ static const char *gssFuncStr[] = { static PRFuncPtr gssFunPtr[gssFuncItems]; static PRBool gssNativeImp = PR_TRUE; -static PRBool gssFunInit = PR_FALSE; +static PRLibrary* gssLibrary = nsnull; #define gss_display_status_ptr ((gss_display_status_type)*gssFunPtr[0]) #define gss_init_sec_context_ptr ((gss_init_sec_context_type)*gssFunPtr[1]) @@ -223,7 +223,7 @@ gssInit() } #endif - gssFunInit = PR_TRUE; + gssLibrary = lib; return NS_OK; } @@ -242,7 +242,7 @@ LogGssError(OM_uint32 maj_stat, OM_uint32 min_stat, const char *prefix) nsCAutoString errorStr; errorStr.Assign(prefix); - if (!gssFunInit) + if (!gssLibrary) return; errorStr += ": "; @@ -296,7 +296,7 @@ nsAuthGSSAPI::nsAuthGSSAPI(pType package) mComplete = PR_FALSE; - if (!gssFunInit && NS_FAILED(gssInit())) + if (!gssLibrary && NS_FAILED(gssInit())) return; mCtx = GSS_C_NO_CONTEXT; @@ -340,7 +340,7 @@ nsAuthGSSAPI::nsAuthGSSAPI(pType package) void nsAuthGSSAPI::Reset() { - if (gssFunInit && mCtx != GSS_C_NO_CONTEXT) { + if (gssLibrary && mCtx != GSS_C_NO_CONTEXT) { OM_uint32 minor_status; gss_delete_sec_context_ptr(&minor_status, &mCtx, GSS_C_NO_BUFFER); } @@ -348,6 +348,15 @@ nsAuthGSSAPI::Reset() mComplete = PR_FALSE; } +/* static */ void +nsAuthGSSAPI::Shutdown() +{ + if (gssLibrary) { + PR_UnloadLibrary(gssLibrary); + gssLibrary = nsnull; + } +} + NS_IMPL_ISUPPORTS1(nsAuthGSSAPI, nsIAuthModule) NS_IMETHODIMP @@ -365,7 +374,7 @@ nsAuthGSSAPI::Init(const char *serviceName, LOG(("entering nsAuthGSSAPI::Init()\n")); - if (!gssFunInit) + if (!gssLibrary) return NS_ERROR_NOT_INITIALIZED; mServiceName = serviceName; @@ -390,7 +399,7 @@ nsAuthGSSAPI::GetNextToken(const void *inToken, LOG(("entering nsAuthGSSAPI::GetNextToken()\n")); - if (!gssFunInit) + if (!gssLibrary) return NS_ERROR_NOT_INITIALIZED; // If they've called us again after we're complete, reset to start afresh. diff --git a/mozilla/extensions/auth/nsAuthGSSAPI.h b/mozilla/extensions/auth/nsAuthGSSAPI.h index c6a0925126b..8ff0b5053a2 100644 --- a/mozilla/extensions/auth/nsAuthGSSAPI.h +++ b/mozilla/extensions/auth/nsAuthGSSAPI.h @@ -60,6 +60,8 @@ public: nsAuthGSSAPI(pType package); + static void Shutdown(); + private: ~nsAuthGSSAPI() { Reset(); } diff --git a/mozilla/extensions/pref/system-pref/src/gconf/nsSystemPrefService.cpp b/mozilla/extensions/pref/system-pref/src/gconf/nsSystemPrefService.cpp index 0d5f35da3b2..4759521aa91 100644 --- a/mozilla/extensions/pref/system-pref/src/gconf/nsSystemPrefService.cpp +++ b/mozilla/extensions/pref/system-pref/src/gconf/nsSystemPrefService.cpp @@ -610,6 +610,8 @@ GConfProxy::~GConfProxy() (void)mObservers->EnumerateForwards(gconfDeleteObserver, nsnull); delete mObservers; } + + PR_UnloadLibrary(mGConfLib); } PRBool diff --git a/mozilla/gfx/src/thebes/nsSystemFontsGTK2.cpp b/mozilla/gfx/src/thebes/nsSystemFontsGTK2.cpp index 1c65c6c27bb..802bd921cd2 100644 --- a/mozilla/gfx/src/thebes/nsSystemFontsGTK2.cpp +++ b/mozilla/gfx/src/thebes/nsSystemFontsGTK2.cpp @@ -56,10 +56,11 @@ #include "gfxPlatformGtk.h" // Glue to avoid build/runtime dependencies on Pango > 1.6 - +#ifndef THEBES_USE_PANGO_CAIRO static gboolean (* PTR_pango_font_description_get_size_is_absolute)(PangoFontDescription*) = nsnull; +static PRLibrary *gPangoLib = nsnull; static void InitPangoLib() { @@ -68,15 +69,23 @@ static void InitPangoLib() return; initialized = PR_TRUE; - PRLibrary* lib = PR_LoadLibrary("libpango-1.0.so"); - if (!lib) + gPangoLib = PR_LoadLibrary("libpango-1.0.so"); + if (!gPangoLib) return; PTR_pango_font_description_get_size_is_absolute = (gboolean (*)(PangoFontDescription*)) - PR_FindFunctionSymbol(lib, "pango_font_description_get_size_is_absolute"); + PR_FindFunctionSymbol(gPangoLib, + "pango_font_description_get_size_is_absolute"); +} - // leak lib deliberately +static void +ShutdownPangoLib() +{ + if (gPangoLib) { + PR_UnloadLibrary(gPangoLib); + gPangoLib = nsnull; + } } static gboolean @@ -89,6 +98,21 @@ MOZ_pango_font_description_get_size_is_absolute(PangoFontDescription *desc) // In old versions of pango, this was always false. return PR_FALSE; } +#else +static inline void InitPangoLib() +{ +} + +static inline void ShutdownPangoLib() +{ +} + +static inline gboolean +MOZ_pango_font_description_get_size_is_absolute(PangoFontDescription *desc) +{ + pango_font_description_get_size_is_absolute(desc); +} +#endif #define DEFAULT_PIXEL_FONT_SIZE 16.0f @@ -181,6 +205,11 @@ nsSystemFontsGTK2::nsSystemFontsGTK2() gtk_widget_destroy(window); // no unref, windows are different } +nsSystemFontsGTK2::~nsSystemFontsGTK2() +{ + ShutdownPangoLib(); +} + nsresult nsSystemFontsGTK2::GetSystemFontInfo(GtkWidget *aWidget, nsString *aFontName, gfxFontStyle *aFontStyle) const diff --git a/mozilla/gfx/src/thebes/nsSystemFontsGTK2.h b/mozilla/gfx/src/thebes/nsSystemFontsGTK2.h index 85d27d75444..422189ab3c9 100644 --- a/mozilla/gfx/src/thebes/nsSystemFontsGTK2.h +++ b/mozilla/gfx/src/thebes/nsSystemFontsGTK2.h @@ -45,6 +45,7 @@ class nsSystemFontsGTK2 { public: nsSystemFontsGTK2(); + ~nsSystemFontsGTK2(); nsresult GetSystemFont(nsSystemFontID anID, nsString *aFontName, gfxFontStyle *aFontStyle) const; diff --git a/mozilla/gfx/thebes/public/gfxPangoFonts.h b/mozilla/gfx/thebes/public/gfxPangoFonts.h index e7c79b8f831..ff86728d7db 100644 --- a/mozilla/gfx/thebes/public/gfxPangoFonts.h +++ b/mozilla/gfx/thebes/public/gfxPangoFonts.h @@ -65,6 +65,8 @@ public: const gfxFontStyle *aFontStyle); virtual ~gfxPangoFont (); + static void Shutdown(); + virtual const gfxFont::Metrics& GetMetrics(); PangoFontDescription *GetPangoFontDescription() { RealizeFont(); return mPangoFontDesc; } diff --git a/mozilla/gfx/thebes/src/gfxBeOSPlatform.cpp b/mozilla/gfx/thebes/src/gfxBeOSPlatform.cpp index 4c2929410d9..629d6046b9b 100644 --- a/mozilla/gfx/thebes/src/gfxBeOSPlatform.cpp +++ b/mozilla/gfx/thebes/src/gfxBeOSPlatform.cpp @@ -37,6 +37,7 @@ #include "gfxBeOSPlatform.h" #include "gfxFontconfigUtils.h" +#include "gfxPangoFonts.h" #include "gfxImageSurface.h" #include "gfxBeOSSurface.h" @@ -54,6 +55,8 @@ gfxBeOSPlatform::~gfxBeOSPlatform() gfxFontconfigUtils::Shutdown(); sFontconfigUtils = nsnull; + gfxPangoFont::Shutdown(); + #if 0 // It would be nice to do this (although it might need to be after // the cairo shutdown that happens in ~gfxPlatform). It even looks diff --git a/mozilla/gfx/thebes/src/gfxPangoFonts.cpp b/mozilla/gfx/thebes/src/gfxPangoFonts.cpp index 8f3a5d0eb37..04faaab3f62 100644 --- a/mozilla/gfx/thebes/src/gfxPangoFonts.cpp +++ b/mozilla/gfx/thebes/src/gfxPangoFonts.cpp @@ -196,6 +196,7 @@ gfxPangoFontGroup::Copy(const gfxFontStyle *aStyle) static void (* PTR_pango_font_description_set_absolute_size)(PangoFontDescription*, double) = nsnull; +static PRLibrary *gPangoLib = nsnull; static void InitPangoLib() { @@ -206,17 +207,16 @@ static void InitPangoLib() g_type_init(); - PRLibrary *lib = PR_LoadLibrary("libpango-1.0.so"); - if (!lib) + gPangoLib = PR_LoadLibrary("libpango-1.0.so"); + if (!gPangoLib) return; PTR_pango_font_description_set_absolute_size = (void (*)(PangoFontDescription*, double)) - PR_FindFunctionSymbol(lib, "pango_font_description_set_absolute_size"); + PR_FindFunctionSymbol(gPangoLib, + "pango_font_description_set_absolute_size"); - // leak lib deliberately - - lib = nsnull; + PRLibrary *lib = nsnull; int *xft_max_freetype_files_ptr = nsnull; xft_max_freetype_files_ptr = (int*) PR_FindSymbolAndLibrary("XftMaxFreeTypeFiles", &lib); if (xft_max_freetype_files_ptr && *xft_max_freetype_files_ptr < 50) @@ -225,6 +225,15 @@ static void InitPangoLib() PR_UnloadLibrary(lib); } +static void +ShutdownPangoLib() +{ + if (gPangoLib) { + PR_UnloadLibrary(gPangoLib); + gPangoLib = nsnull; + } +} + static void MOZ_pango_font_description_set_absolute_size(PangoFontDescription *desc, double size) @@ -238,11 +247,15 @@ MOZ_pango_font_description_set_absolute_size(PangoFontDescription *desc, } } #else -static void InitPangoLib() +static inline void InitPangoLib() { } -static void +static inline void ShutdownPangoLib() +{ +} + +static inline void MOZ_pango_font_description_set_absolute_size(PangoFontDescription *desc, double size) { pango_font_description_set_absolute_size(desc, size); @@ -271,6 +284,12 @@ gfxPangoFont::~gfxPangoFont() cairo_scaled_font_destroy(mCairoFont); } +/* static */ void +gfxPangoFont::Shutdown() +{ + ShutdownPangoLib(); +} + static PangoStyle ThebesStyleToPangoStyle (const gfxFontStyle *fs) { diff --git a/mozilla/gfx/thebes/src/gfxPlatformGtk.cpp b/mozilla/gfx/thebes/src/gfxPlatformGtk.cpp index 81f72afdf16..03b5cb11475 100644 --- a/mozilla/gfx/thebes/src/gfxPlatformGtk.cpp +++ b/mozilla/gfx/thebes/src/gfxPlatformGtk.cpp @@ -42,6 +42,7 @@ #include "gfxPlatformGtk.h" #include "gfxFontconfigUtils.h" +#include "gfxPangoFonts.h" #include "cairo.h" #include @@ -92,6 +93,9 @@ gfxPlatformGtk::~gfxPlatformGtk() { gfxFontconfigUtils::Shutdown(); sFontconfigUtils = nsnull; + + gfxPangoFont::Shutdown(); + #ifndef THEBES_USE_PANGO_CAIRO pango_xft_shutdown_display(GDK_DISPLAY(), 0); #endif diff --git a/mozilla/uriloader/exthandler/unix/nsGNOMERegistry.cpp b/mozilla/uriloader/exthandler/unix/nsGNOMERegistry.cpp index f1e57e04ef7..85ed2b7a6cb 100644 --- a/mozilla/uriloader/exthandler/unix/nsGNOMERegistry.cpp +++ b/mozilla/uriloader/exthandler/unix/nsGNOMERegistry.cpp @@ -102,14 +102,18 @@ static void CleanUp() { // Unload all libraries - if (gnomeLib) + if (gnomeLib) { PR_UnloadLibrary(gnomeLib); - if (gconfLib) + gnomeLib = nsnull; + } + if (gconfLib) { PR_UnloadLibrary(gconfLib); - if (vfsLib) + gconfLib = nsnull; + } + if (vfsLib) { PR_UnloadLibrary(vfsLib); - - gnomeLib = gconfLib = vfsLib = nsnull; + vfsLib = nsnull; + } } static PRLibrary * diff --git a/mozilla/widget/src/gtk/nsSound.cpp b/mozilla/widget/src/gtk/nsSound.cpp index 82f2f650319..fc3823406c5 100644 --- a/mozilla/widget/src/gtk/nsSound.cpp +++ b/mozilla/widget/src/gtk/nsSound.cpp @@ -124,6 +124,15 @@ nsSound::Init() return NS_OK; } +/* static */ void +nsSound::Shutdown() +{ + if (elib) { + PR_UnloadLibrary(elib) + elib = nsnull; + } +} + #define GET_WORD(s, i) (s[i+1] << 8) | s[i] #define GET_DWORD(s, i) (s[i+3] << 24) | (s[i+2] << 16) | (s[i+1] << 8) | s[i] diff --git a/mozilla/widget/src/gtk/nsSound.h b/mozilla/widget/src/gtk/nsSound.h index 444316812ef..bd0062c322c 100644 --- a/mozilla/widget/src/gtk/nsSound.h +++ b/mozilla/widget/src/gtk/nsSound.h @@ -53,6 +53,8 @@ class nsSound : public nsISound, nsSound(); virtual ~nsSound(); + static void Shutdown(); + NS_DECL_ISUPPORTS NS_DECL_NSISOUND NS_DECL_NSISTREAMLOADEROBSERVER diff --git a/mozilla/widget/src/gtk2/nsIdleServiceGTK.cpp b/mozilla/widget/src/gtk2/nsIdleServiceGTK.cpp index 51cfe05cc1f..0d5dd219f01 100644 --- a/mozilla/widget/src/gtk2/nsIdleServiceGTK.cpp +++ b/mozilla/widget/src/gtk2/nsIdleServiceGTK.cpp @@ -68,6 +68,7 @@ NS_IMPL_ISUPPORTS1(nsIdleServiceGTK, nsIIdleService) nsIdleServiceGTK::nsIdleServiceGTK() : mXssInfo(nsnull) { + NS_ASSERTION(!xsslib, "created two instances of the idle service"); #ifdef PR_LOGGING if (!sIdleLog) sIdleLog = PR_NewLogModule("nsIIdleService"); @@ -103,8 +104,10 @@ nsIdleServiceGTK::~nsIdleServiceGTK() { if (mXssInfo) XFree(mXssInfo); - if (xsslib) + if (xsslib) { PR_UnloadLibrary(xsslib); + xsslib = nsnull; + } } NS_IMETHODIMP diff --git a/mozilla/widget/src/gtk2/nsSound.cpp b/mozilla/widget/src/gtk2/nsSound.cpp index e0757febf5d..a370cdb43f6 100644 --- a/mozilla/widget/src/gtk2/nsSound.cpp +++ b/mozilla/widget/src/gtk2/nsSound.cpp @@ -95,7 +95,7 @@ nsSound::~nsSound() { /* see above comment */ if (esdref != -1) { - EsdCloseType EsdClose = (EsdCloseType) PR_FindSymbol(elib, "esd_close"); + EsdCloseType EsdClose = (EsdCloseType) PR_FindFunctionSymbol(elib, "esd_close"); (*EsdClose)(esdref); esdref = -1; } @@ -117,7 +117,7 @@ nsSound::Init() elib = PR_LoadLibrary("libesd.so.0"); if (!elib) return NS_ERROR_FAILURE; - EsdOpenSound = (EsdOpenSoundType) PR_FindSymbol(elib, "esd_open_sound"); + EsdOpenSound = (EsdOpenSoundType) PR_FindFunctionSymbol(elib, "esd_open_sound"); if (!EsdOpenSound) return NS_ERROR_FAILURE; @@ -132,6 +132,15 @@ nsSound::Init() return NS_OK; } +/* static */ void +nsSound::Shutdown() +{ + if (elib) { + PR_UnloadLibrary(elib); + elib = nsnull; + } +} + #define GET_WORD(s, i) (s[i+1] << 8) | s[i] #define GET_DWORD(s, i) (s[i+3] << 24) | (s[i+2] << 16) | (s[i+1] << 8) | s[i] @@ -259,8 +268,8 @@ NS_IMETHODIMP nsSound::OnStreamComplete(nsIStreamLoader *aLoader, /* open up connection to esd */ EsdPlayStreamType EsdPlayStream = - (EsdPlayStreamType) PR_FindSymbol(elib, - "esd_play_stream"); + (EsdPlayStreamType) PR_FindFunctionSymbol(elib, + "esd_play_stream"); // XXX what if that fails? (Bug 241738) mask = ESD_PLAY | ESD_STREAM; @@ -298,9 +307,9 @@ NS_IMETHODIMP nsSound::OnStreamComplete(nsIStreamLoader *aLoader, if (fd < 0) { int *esd_audio_format = (int *) PR_FindSymbol(elib, "esd_audio_format"); int *esd_audio_rate = (int *) PR_FindSymbol(elib, "esd_audio_rate"); - EsdAudioOpenType EsdAudioOpen = (EsdAudioOpenType) PR_FindSymbol(elib, "esd_audio_open"); - EsdAudioWriteType EsdAudioWrite = (EsdAudioWriteType) PR_FindSymbol(elib, "esd_audio_write"); - EsdAudioCloseType EsdAudioClose = (EsdAudioCloseType) PR_FindSymbol(elib, "esd_audio_close"); + EsdAudioOpenType EsdAudioOpen = (EsdAudioOpenType) PR_FindFunctionSymbol(elib, "esd_audio_open"); + EsdAudioWriteType EsdAudioWrite = (EsdAudioWriteType) PR_FindFunctionSymbol(elib, "esd_audio_write"); + EsdAudioCloseType EsdAudioClose = (EsdAudioCloseType) PR_FindFunctionSymbol(elib, "esd_audio_close"); *esd_audio_format = mask; *esd_audio_rate = samples_per_sec; diff --git a/mozilla/widget/src/gtk2/nsSound.h b/mozilla/widget/src/gtk2/nsSound.h index f8c8cc21fe2..5bdf9adc094 100644 --- a/mozilla/widget/src/gtk2/nsSound.h +++ b/mozilla/widget/src/gtk2/nsSound.h @@ -53,6 +53,8 @@ public: nsSound(); virtual ~nsSound(); + static void Shutdown(); + NS_DECL_ISUPPORTS NS_DECL_NSISOUND NS_DECL_NSISTREAMLOADEROBSERVER diff --git a/mozilla/widget/src/gtk2/nsWidgetFactory.cpp b/mozilla/widget/src/gtk2/nsWidgetFactory.cpp index b2af603b752..9514066d597 100644 --- a/mozilla/widget/src/gtk2/nsWidgetFactory.cpp +++ b/mozilla/widget/src/gtk2/nsWidgetFactory.cpp @@ -280,6 +280,7 @@ PR_STATIC_CALLBACK(void) nsWidgetGtk2ModuleDtor(nsIModule *aSelf) { nsFilePicker::Shutdown(); + nsSound::Shutdown(); nsWindow::ReleaseGlobals(); nsAppShellShutdown(aSelf); } diff --git a/mozilla/widget/src/gtk2/nsWindow.cpp b/mozilla/widget/src/gtk2/nsWindow.cpp index 2595f48c11b..a24d1786198 100644 --- a/mozilla/widget/src/gtk2/nsWindow.cpp +++ b/mozilla/widget/src/gtk2/nsWindow.cpp @@ -1012,8 +1012,18 @@ nsWindow::SetCursor(imgIContainer* aCursor, PRLibrary* lib; _gdk_cursor_new_from_pixbuf = (_gdk_cursor_new_from_pixbuf_fn) PR_FindFunctionSymbolAndLibrary("gdk_cursor_new_from_pixbuf", &lib); + if (lib) { + // We already link against GDK, so we can unload it. + PR_UnloadLibrary(lib); + lib = nsnull; + } _gdk_display_get_default = (_gdk_display_get_default_fn) PR_FindFunctionSymbolAndLibrary("gdk_display_get_default", &lib); + if (lib) { + // We already link against GDK, so we can unload it. + PR_UnloadLibrary(lib); + lib = nsnull; + } sPixbufCursorChecked = PR_TRUE; } mCursor = nsCursor(-1); diff --git a/mozilla/xpcom/io/nsILocalFile.idl b/mozilla/xpcom/io/nsILocalFile.idl index 8d7a1ddada9..647bebca476 100644 --- a/mozilla/xpcom/io/nsILocalFile.idl +++ b/mozilla/xpcom/io/nsILocalFile.idl @@ -101,9 +101,22 @@ interface nsILocalFile : nsIFile */ attribute PRBool followLinks; + /** + * Return the result of PR_Open on the file. The caller is + * responsible for calling PR_Close on the result. + */ [noscript] PRFileDescStar openNSPRFileDesc(in long flags, in long mode); + + /** + * Return the result of fopen on the file. The caller is + * responsible for calling fclose on the result. + */ [noscript] FILE openANSIFileDesc(in string mode); + /** + * Return the result of PR_LoadLibrary on the file. The caller is + * responsible for calling PR_UnloadLibrary on the result. + */ [noscript] PRLibraryStar load(); readonly attribute PRInt64 diskSpaceAvailable;