bad-plugin-finalization
author Benjamin Smedberg <benjamin@smedbergs.us>
Sat, 26 Jul 2008 22:49:39 -0400
changeset 167 a4da40849f5436e629c5732f4368c6c48189637f
parent 95 b35cbfa6ad4f8bac97b5a0ae2a3bfc18ed88de35
permissions -rw-r--r--
State as of now

diff --git a/modules/plugin/base/src/nsPluginHostImpl.cpp b/modules/plugin/base/src/nsPluginHostImpl.cpp
--- a/modules/plugin/base/src/nsPluginHostImpl.cpp
+++ b/modules/plugin/base/src/nsPluginHostImpl.cpp
@@ -916,7 +916,8 @@ nsPluginTag::~nsPluginTag()
   // Remove mime types added to the category manager
   // only if we were made 'active' by setting the host
   if (mPluginHost) {
-    RegisterWithCategoryManager(PR_FALSE, nsPluginTag::ePluginUnregister);
+    // XXXbsmedberg: this is finalizer-bad. Explicitly close plugins!
+    // RegisterWithCategoryManager(PR_FALSE, nsPluginTag::ePluginUnregister);
   }
 
   if (mMimeTypeArray) {
diff --git a/modules/plugin/base/src/nsPluginHostImpl.h b/modules/plugin/base/src/nsPluginHostImpl.h
--- a/modules/plugin/base/src/nsPluginHostImpl.h
+++ b/modules/plugin/base/src/nsPluginHostImpl.h
@@ -226,8 +226,6 @@ public:
   virtual ~nsPluginHostImpl();
 
   static nsPluginHostImpl* GetInst();
-
-  NS_DECL_AND_IMPL_ZEROING_OPERATOR_NEW
 
   NS_DECL_ISUPPORTS
 
diff --git a/modules/plugin/base/src/nsPluginsDir.h b/modules/plugin/base/src/nsPluginsDir.h
--- a/modules/plugin/base/src/nsPluginsDir.h
+++ b/modules/plugin/base/src/nsPluginsDir.h
@@ -79,7 +79,7 @@ struct nsPluginInfo {
  */
 class nsPluginFile {
   PRLibrary* pLibrary;
-  nsCOMPtr<nsIFile> mPlugin;
+  nsIFile* mPlugin;
 public:
 	/**
 	 * If spec corresponds to a valid plugin file, constructs a reference