webengine/osswebengine/WebKit/s60/plugins/PluginHandler.cpp
branchRCL_3
changeset 94 919f36ff910f
parent 93 79859ed3eea9
--- a/webengine/osswebengine/WebKit/s60/plugins/PluginHandler.cpp	Tue Aug 31 16:17:46 2010 +0300
+++ b/webengine/osswebengine/WebKit/s60/plugins/PluginHandler.cpp	Wed Sep 01 12:28:30 2010 +0100
@@ -31,7 +31,7 @@
 
 //  INCLUDES
 #include "WebCorePluginHandler.h"
-#include "NpnImplementation.h"
+#include "NPNImplementation.h"
 #include "PluginHandler.h"
 
 // CONSTANTS
@@ -157,7 +157,7 @@
 {
     TUint   i;
     TUint   count;
-    HBufC*  entry;
+    HBufC*  entry = NULL;
     
     m_mimeTypes.ResetAndDestroy();
     m_mimeExtensionToTypeMap.Reset();
@@ -415,6 +415,7 @@
 {
     m_idle = CIdle::NewL(CActive::EPriorityLow);
     m_idle->Start(TCallBack(initialize, this));
+    m_visiblePlugins.Reset();
 }
 
 
@@ -441,6 +442,8 @@
 //
 PluginHandler::~PluginHandler()
 {
+    m_visiblePlugins.Reset();
+    m_visiblePlugins.Close();
     m_pluginInfoArray.ResetAndDestroy();
     m_pluginInfoArray.Close();
     m_pluginObjects.clear();
@@ -477,6 +480,15 @@
 // Loads all the plugins and query them for details.
 // -----------------------------------------------------------------------------
 //
+static void CleanupPluginInfoArray( TAny* aObj )
+    {
+    if ( aObj )
+        {
+        static_cast<RImplInfoPtrArray*>( aObj )->ResetAndDestroy();
+        static_cast<RImplInfoPtrArray*>( aObj )->Close();
+        }
+    }
+ 
 TBool PluginHandler::loadPluginsL()
 {
     
@@ -489,6 +501,7 @@
 
     // Create the ECom info array, contains the plugin information
     RImplInfoPtrArray ecomPluginInfoArray;
+    CleanupStack::PushL(TCleanupItem(CleanupPluginInfoArray, &ecomPluginInfoArray ) );
 
     // Get list of ECOM plugins that match the KNBrowserPluginInterfaceUid
     REComSession::ListImplementationsL(KBrowserPluginInterfaceUid, ecomPluginInfoArray);
@@ -519,8 +532,7 @@
     }
 
     // Clean up the ECom info array
-    ecomPluginInfoArray.ResetAndDestroy();
-    ecomPluginInfoArray.Close();
+    CleanupStack::PopAndDestroy( &ecomPluginInfoArray );
     
     m_pluginsLoaded = ETrue;
     return EFalse;