idlehomescreen/xmluicontroller/src/aixuikoneventhandler.cpp
branchRCL_3
changeset 16 9674c1a575e9
parent 9 f966699dea19
--- a/idlehomescreen/xmluicontroller/src/aixuikoneventhandler.cpp	Fri Mar 12 15:41:49 2010 +0200
+++ b/idlehomescreen/xmluicontroller/src/aixuikoneventhandler.cpp	Mon Mar 15 12:39:47 2010 +0200
@@ -104,7 +104,8 @@
 CAIXuikonEventHandler::CAIXuikonEventHandler( CXmlUiController& aUiController,
                                              CContentRenderer& aRenderer )
     : iUiController(aUiController),
-      iContentRenderer(aRenderer)
+      iContentRenderer(aRenderer),
+      iAiEventHandler( NULL )
     {
     }
 
@@ -145,7 +146,7 @@
     {
     delete iNullEventHandler;
     delete iVolumeEvent;
-    
+    delete iAiEventHandler;
     Release( iStrParser );
     }
 
@@ -225,10 +226,13 @@
         // Event is not targeted here
         return EFalse;
         }
-    CAIEventHandler* handler = CAIEventHandler::NewL( iUiController );
-    CleanupStack::PushL( handler );
-    handler->HandleEventL( aEventText, aEvent );
-    CleanupStack::PopAndDestroy( handler );
+    
+    if ( !iAiEventHandler )
+        {
+        iAiEventHandler = CAIEventHandler::NewL( iUiController );
+        }
+    iAiEventHandler->HandleEventL( aEventText, aEvent );
+    
     return ETrue;
     }