--- a/videocollection/mpxmyvideoscollection/src/vcxmyvideosvideocache.cpp Mon Jan 18 20:21:12 2010 +0200
+++ b/videocollection/mpxmyvideoscollection/src/vcxmyvideosvideocache.cpp Tue Jan 26 12:00:59 2010 +0200
@@ -68,6 +68,8 @@
delete iVideoList;
delete iDownloadCache;
+ delete iCenRep;
+
DeletePartialList();
}
@@ -1317,17 +1319,18 @@
//
TVcxMyVideosSortingOrder CVcxMyVideosVideoCache::SortingOrderL()
{
- TUid uid;
- uid.iUid = KVcxMyVideosCollectionCenrepUid;
- CRepository* cenRep = CRepository::NewL( uid );
- CleanupStack::PushL( cenRep ); // 1->
+
+ if( !iCenRep )
+ {
+ TUid uid;
+ uid.iUid = KVcxMyVideosCollectionCenrepUid;
+ iCenRep = CRepository::NewL( uid );
+ }
TInt sortingOrderInCenrep;
- TInt cenRepError = cenRep->Get( KVcxMyVideosCollectionCenrepKeySortingOrder,
+ TInt cenRepError = iCenRep->Get( KVcxMyVideosCollectionCenrepKeySortingOrder,
sortingOrderInCenrep );
-
- CleanupStack::PopAndDestroy( cenRep ); // <-1
TVcxMyVideosSortingOrder sortingOrder;