--- a/appinstaller/AppinstUi/Client/Src/SWInstLauncher.cpp Wed Sep 01 12:22:02 2010 +0100
+++ b/appinstaller/AppinstUi/Client/Src/SWInstLauncher.cpp Tue Sep 14 21:31:28 2010 +0300
@@ -25,6 +25,7 @@
#include "SWInstDefs.h"
#include "SWInstCommon.h"
+
using namespace SwiUI;
// ================= MEMBER FUNCTIONS =======================
@@ -48,16 +49,17 @@
//
EXPORT_C TInt RSWInstLauncher::Connect()
{
+
TInt result( KErrNone );
if ( !iConnected )
{
if ( CEikonEnv::Static() )
- {
+ {
TRAP( result, ConnectChainedAppL( KUidSWInstSvr ) );
}
else
- {
+ {
TRAP( result, REikAppServiceBase::ConnectNewAppL( KUidSWInstSvr ) );
}
@@ -78,12 +80,22 @@
// -----------------------------------------------------------------------------
//
EXPORT_C void RSWInstLauncher::Close()
- {
+ {
if ( iConnected )
{
- RAknAppServiceBase::Close();
+ if ( CEikonEnv::Static() )
+ {
+ // Note this will crash if non ui application like SWI Daemon.
+ RAknAppServiceBase::Close();
+ }
+ else
+ {
+ // Use EikAppServiceBase if non UI application.
+ REikAppServiceBase::Close();
+ }
+
iConnected = EFalse;
- }
+ }
}
// -----------------------------------------------------------------------------