Fix memory leak issue due to timing 58/298958/3
authorEunki Hong <eunkiki.hong@samsung.com>
Fri, 15 Sep 2023 14:53:17 +0000 (23:53 +0900)
committerEunki, Hong <eunkiki.hong@samsung.com>
Mon, 18 Sep 2023 02:33:55 +0000 (11:33 +0900)
Since thread timing issue, it is possible that DiscardResourceId
before CreateResourceId.

Since it is hard to resolve timing issue, let we just upload texture
after event message flushed.

Change-Id: Ic03fbc1709555427be6549e0f4a23aa84102fd53
Signed-off-by: Eunki Hong <eunkiki.hong@samsung.com>
dali/internal/adaptor/common/combined-update-render-controller.cpp

index 0f0b98e..648ef81 100644 (file)
@@ -601,7 +601,7 @@ void CombinedUpdateRenderController::UpdateRenderThread()
     }
 
     //////////////////////////////
-    // TextureUploadRequest
+    // TextureUploadRequest (phase #1)
     //////////////////////////////
 
     // Upload requested resources after resource context activated.
@@ -686,8 +686,16 @@ void CombinedUpdateRenderController::UpdateRenderThread()
       }
     }
 
+    //////////////////////////////
+    // TextureUploadRequest (phase #2)
+    //////////////////////////////
+
+    // Upload requested resources after resource context activated.
     graphics.ActivateResourceContext();
 
+    // Since uploadOnly value used at Update side, we should not change uploadOnly value now even some textures are uploaded.
+    mTextureUploadManager.ResourceUpload();
+
     if(mFirstFrameAfterResume)
     {
       // mFirstFrameAfterResume is set to true when the thread is resumed