diff options
Diffstat (limited to 'plugin')
-rw-r--r-- | plugin/icedteanp/IcedTeaNPPlugin.cc | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/plugin/icedteanp/IcedTeaNPPlugin.cc b/plugin/icedteanp/IcedTeaNPPlugin.cc index 0c37554..5ce3489 100644 --- a/plugin/icedteanp/IcedTeaNPPlugin.cc +++ b/plugin/icedteanp/IcedTeaNPPlugin.cc @@ -2009,14 +2009,12 @@ NP_Initialize (NPNetscapeFuncs* browserTable, NPPluginFuncs* pluginTable) { PLUGIN_DEBUG ("NP_Initialize\n"); - if (initialized) - return NPERR_NO_ERROR; - else if ((browserTable == NULL) || (pluginTable == NULL)) - { - PLUGIN_ERROR ("Browser or plugin function table is NULL."); + if ((browserTable == NULL) || (pluginTable == NULL)) + { + PLUGIN_ERROR ("Browser or plugin function table is NULL."); - return NPERR_INVALID_FUNCTABLE_ERROR; - } + return NPERR_INVALID_FUNCTABLE_ERROR; + } // Ensure that the major version of the plugin API that the browser // expects is not more recent than the major version of the API that @@ -2123,6 +2121,12 @@ NP_Initialize (NPNetscapeFuncs* browserTable, NPPluginFuncs* pluginTable) pluginTable->getvalue = NPP_GetValueProcPtr (ITNP_GetValue); #endif + // Re-setting the above tables multiple times is OK (as the + // browser may change its function locations). However + // anything beyond this point should only run once. + if (initialized) + return NPERR_NO_ERROR; + // Make sure the plugin data directory exists, creating it if // necessary. data_directory = g_strconcat (P_tmpdir, NULL); |