From 355745949de265a91caffa4a92b25d491482a541 Mon Sep 17 00:00:00 2001 From: "peterlubczynski%netscape.com" Date: Thu, 20 Sep 2001 00:46:50 +0000 Subject: [PATCH] Fix for OS X crash with bundle type plugins bug 98729 r=beard sr=attinasi --- modules/plugin/base/src/nsPluginHostImpl.cpp | 4 ++++ modules/plugin/base/src/nsPluginsDir.h | 3 +++ modules/plugin/base/src/nsPluginsDirMac.cpp | 9 +++++++++ 3 files changed, 16 insertions(+) diff --git a/modules/plugin/base/src/nsPluginHostImpl.cpp b/modules/plugin/base/src/nsPluginHostImpl.cpp index 3ca01836a00d..33fce7f4a5e8 100644 --- a/modules/plugin/base/src/nsPluginHostImpl.cpp +++ b/modules/plugin/base/src/nsPluginHostImpl.cpp @@ -831,6 +831,10 @@ nsPluginTag::nsPluginTag(nsPluginInfo* aPluginInfo) mLibrary = nsnull; mCanUnloadLibrary = PR_TRUE; mEntryPoint = nsnull; + +#if TARGET_CARBON + mCanUnloadLibrary = !aPluginInfo->fBundle; +#endif mFlags = NS_PLUGIN_FLAG_ENABLED; mXPConnected = PR_FALSE; } diff --git a/modules/plugin/base/src/nsPluginsDir.h b/modules/plugin/base/src/nsPluginsDir.h index 2df46a6ad64b..fd6e3af63eaa 100644 --- a/modules/plugin/base/src/nsPluginsDir.h +++ b/modules/plugin/base/src/nsPluginsDir.h @@ -68,6 +68,9 @@ struct nsPluginInfo { char** fExtensionArray; char* fFileName; char* fFullPath; +#if TARGET_CARBON + PRBool fBundle; +#endif }; /** diff --git a/modules/plugin/base/src/nsPluginsDirMac.cpp b/modules/plugin/base/src/nsPluginsDirMac.cpp index a201387b17b5..fdf5f3be5dc6 100644 --- a/modules/plugin/base/src/nsPluginsDirMac.cpp +++ b/modules/plugin/base/src/nsPluginsDirMac.cpp @@ -259,6 +259,15 @@ nsresult nsPluginFile::GetPluginInfo(nsPluginInfo& info) info.fFileName = p2cstrdup(spec.name); info.fFullPath = PL_strdup(this->GetCString()); +#if TARGET_CARBON + CFBundleRef bundle = getPluginBundle(spec); + if (bundle) { + info.fBundle = PR_TRUE; + CFRelease(bundle); + } else + info.fBundle = PR_FALSE; +#endif + short mimeIndex = 1, descriptionIndex = 1; for (int i = 0; i < variantCount; i++) { info.fMimeTypeArray[i] = GetPluginString(128, mimeIndex++);