Check for NULL resource ticket pointer 01/30901/2
authorKevin Butchart <k.butchart@partner.samsung.com>
Wed, 26 Nov 2014 17:50:07 +0000 (17:50 +0000)
committerKimmo Hoikka <kimmo.hoikka@samsung.com>
Thu, 27 Nov 2014 13:41:24 +0000 (05:41 -0800)
When reloading resources after context loss, it is possible for
some of the resources to have already been destroyed, but still
be in the map in the image factory. In this case the search
for the ResourceTicket returns a NULL pointer which should be
checked for.

Change-Id: I967e7e07021903ad57d9a1617295bf94f16b53b6

dali/internal/event/images/image-factory.cpp

index fb59e82..38203c6 100644 (file)
@@ -193,7 +193,8 @@ void ImageFactory::RecoverFromContextLoss()
       ResourceTicketPtr ticket = mResourceClient.RequestResourceTicket( request->resourceId );
 
       // do not reload if still loading
-      if ( ticket->GetLoadingState() != ResourceLoading )
+      // check ticket is not NULL as the resource could have already been destroyed
+      if ( ticket && ticket->GetLoadingState() != ResourceLoading )
       {
         // Ensure the finished status is reset
         mResourceClient.ReloadResource( ticket->GetId(), true );