diff -r adbe7d5ba2f5 -r 45e72b57a2fd videocollection/videocollectionview/src/videocollectionviewplugin.cpp --- a/videocollection/videocollectionview/src/videocollectionviewplugin.cpp Wed Jun 23 18:14:16 2010 +0300 +++ b/videocollection/videocollectionview/src/videocollectionviewplugin.cpp Tue Jul 06 14:17:50 2010 +0300 @@ -15,7 +15,7 @@ * */ -// Version : %version: 23 % +// Version : %version: 24 % // INCLUDE FILES #include @@ -41,7 +41,7 @@ : mUiLoader( 0 ) , mView( 0 ) , mActivated( false ) - , mIsService( false ) + , mVideoServices( 0 ) { FUNC_LOG; } @@ -72,14 +72,8 @@ } mUiLoader->reset(); - - if (XQServiceUtil::isService()) - { - INFO("VideoCollectionViewPlugin::createView() service flag set to true."); - mIsService = true; - } - mUiLoader->setIsService(mIsService); + mUiLoader->setIsService(XQServiceUtil::isService()); bool ok(false); @@ -145,6 +139,12 @@ mView = 0; delete mUiLoader; mUiLoader = 0; + + if(mVideoServices) + { + mVideoServices->decreaseReferenceCount(); + mVideoServices = 0; + } } // --------------------------------------------------------------------------- @@ -163,17 +163,18 @@ bool isService = XQServiceUtil::isService(); if (isService) { - VideoServices *videoServices = VideoServices::instance(); - if (videoServices) + if(!mVideoServices) { - VideoServices::TVideoService serviceType = - videoServices->currentService(); - if (serviceType == VideoServices::EBrowse) - { - // activate browsing service - itemId.iId1 = videoServices->getBrowseCategory(); - itemId.iId2 = KVcxMvcMediaTypeCategory; - } + mVideoServices = VideoServices::instance(); + } + + VideoServices::TVideoService serviceType = + mVideoServices->currentService(); + if (serviceType == VideoServices::EBrowse) + { + // activate browsing service + itemId.iId1 = mVideoServices->getBrowseCategory(); + itemId.iId2 = KVcxMvcMediaTypeCategory; } } int err = mView->activateView(itemId);