diff -r cdf2f6e5c390 -r bf7481649c98 graphicscomposition/openwfsupport/src/streammap.cpp --- a/graphicscomposition/openwfsupport/src/streammap.cpp Thu May 27 14:13:51 2010 +0300 +++ b/graphicscomposition/openwfsupport/src/streammap.cpp Fri Jun 11 14:58:47 2010 +0300 @@ -17,6 +17,7 @@ #include "streammap.h" #include +#include #include #include #include @@ -119,7 +120,8 @@ RSurfaceManager& COpenWfcStreamMap::SurfaceManager() { - return iSurfaceManager; + WFCI_ASSERT_DEBUG(iSurfaceManager, EOwfPanicInvalidHasMap); + return *iSurfaceManager; } TInt COpenWfcStreamMap::LockDestroy(CSurfaceStream* aStream) @@ -157,6 +159,7 @@ COpenWfcStreamMap::COpenWfcStreamMap(): iMap(THashFunction32(COpenWfcStreamMap::HashFunction), TIdentityRelation()), +iSurfaceManager(NULL), iRegisteredUpdaters() { } @@ -202,7 +205,12 @@ } } iMap.Close(); - iSurfaceManager.Close(); + if (iSurfaceManager) + { + iSurfaceManager->Close(); + delete iSurfaceManager; + iSurfaceManager = NULL; + } iMutex.Signal(); iMutex.Close(); @@ -241,7 +249,8 @@ TSurfaceId surface = TSurfaceId::CreateNullId(); User::LeaveIfError(iMap.Insert(surface, NULL)); - User::LeaveIfError(iSurfaceManager.Open()); + iSurfaceManager = new(ELeave) RSurfaceManager(); + User::LeaveIfError(iSurfaceManager->Open()); RProcess process; TUidType uidType = process.Type(); const TInt32 KWservUid = 268450592;