webengine/osswebengine/WebKit/s60/plugins/PluginHandler.cpp
branchRCL_3
changeset 67 4917f9bf7995
parent 16 a359256acfc6
child 84 800203832575
--- a/webengine/osswebengine/WebKit/s60/plugins/PluginHandler.cpp	Wed Apr 14 17:06:56 2010 +0300
+++ b/webengine/osswebengine/WebKit/s60/plugins/PluginHandler.cpp	Tue Apr 27 17:46:17 2010 +0300
@@ -477,6 +477,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 +498,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 +529,7 @@
     }
 
     // Clean up the ECom info array
-    ecomPluginInfoArray.ResetAndDestroy();
-    ecomPluginInfoArray.Close();
+    CleanupStack::PopAndDestroy( &ecomPluginInfoArray );
     
     m_pluginsLoaded = ETrue;
     return EFalse;