Load the library on all platforms if it hasn't already been loaded. Fix for bug #57885 r=av, sr=waterson.

This commit is contained in:
bnesse%netscape.com 2000-11-13 18:42:43 +00:00
Родитель 129d47bd9c
Коммит d708e3bd34
2 изменённых файлов: 24 добавлений и 26 удалений

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

@ -2848,24 +2848,23 @@ NS_IMETHODIMP nsPluginHostImpl::GetPluginFactory(const char *aMimeType, nsIPlugi
nsPluginTag* pluginTag;
if((rv = FindPluginEnabledForType(aMimeType, pluginTag)) == NS_OK)
{
#ifdef NS_DEBUG
printf("For %s found plugin %s\n", aMimeType, pluginTag->mFileName);
#endif
#ifdef XP_WIN // actually load a dll on Windows
if (nsnull == pluginTag->mLibrary) // if we haven't done this yet
{
nsFileSpec file(pluginTag->mFileName);
#ifdef NS_DEBUG
printf("For %s found plugin %s\n", aMimeType, pluginTag->mFileName);
#endif
nsPluginFile pluginFile(file);
PRLibrary* pluginLibrary = NULL;
nsFileSpec file(pluginTag->mFileName);
if (pluginFile.LoadPlugin(pluginLibrary) != NS_OK || pluginLibrary == NULL)
return NS_ERROR_FAILURE;
nsPluginFile pluginFile(file);
PRLibrary* pluginLibrary = NULL;
pluginTag->mLibrary = pluginLibrary;
if (pluginFile.LoadPlugin(pluginLibrary) != NS_OK || pluginLibrary == NULL)
return NS_ERROR_FAILURE;
pluginTag->mLibrary = pluginLibrary;
#endif
}
nsIPlugin* plugin = pluginTag->mEntryPoint;
if(plugin == NULL)

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

@ -2848,24 +2848,23 @@ NS_IMETHODIMP nsPluginHostImpl::GetPluginFactory(const char *aMimeType, nsIPlugi
nsPluginTag* pluginTag;
if((rv = FindPluginEnabledForType(aMimeType, pluginTag)) == NS_OK)
{
#ifdef NS_DEBUG
printf("For %s found plugin %s\n", aMimeType, pluginTag->mFileName);
#endif
#ifdef XP_WIN // actually load a dll on Windows
if (nsnull == pluginTag->mLibrary) // if we haven't done this yet
{
nsFileSpec file(pluginTag->mFileName);
#ifdef NS_DEBUG
printf("For %s found plugin %s\n", aMimeType, pluginTag->mFileName);
#endif
nsPluginFile pluginFile(file);
PRLibrary* pluginLibrary = NULL;
nsFileSpec file(pluginTag->mFileName);
if (pluginFile.LoadPlugin(pluginLibrary) != NS_OK || pluginLibrary == NULL)
return NS_ERROR_FAILURE;
nsPluginFile pluginFile(file);
PRLibrary* pluginLibrary = NULL;
pluginTag->mLibrary = pluginLibrary;
if (pluginFile.LoadPlugin(pluginLibrary) != NS_OK || pluginLibrary == NULL)
return NS_ERROR_FAILURE;
pluginTag->mLibrary = pluginLibrary;
#endif
}
nsIPlugin* plugin = pluginTag->mEntryPoint;
if(plugin == NULL)