Fix for OS X crash with bundle type plugins bug 98729 r=beard sr=attinasi

This commit is contained in:
peterlubczynski%netscape.com 2001-09-20 00:46:50 +00:00
Родитель 9e991256e0
Коммит 355745949d
3 изменённых файлов: 16 добавлений и 0 удалений

Просмотреть файл

@ -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;
}

Просмотреть файл

@ -68,6 +68,9 @@ struct nsPluginInfo {
char** fExtensionArray;
char* fFileName;
char* fFullPath;
#if TARGET_CARBON
PRBool fBundle;
#endif
};
/**

Просмотреть файл

@ -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++);