Remove external resources lazy. 38/295838/2
authorjmm <j0064423.lee@samsung.com>
Fri, 14 Jul 2023 09:02:44 +0000 (18:02 +0900)
committerjmm <j0064423.lee@samsung.com>
Mon, 17 Jul 2023 04:37:43 +0000 (13:37 +0900)
commitc2936efe23bd2818fb9066ccec12892a5979ba7f
treed8792e9c5af5f25d7768a0b91ade75fb138c47fd
parentae41524f36cf1b2c2525dca196277ddcad6ee29d
Remove external resources lazy.

Since we don't increase & decrease the reference count of ExternalResources during
LoadTexture() API, It can be happened that some TextureId validation failed.

For example of dali://2,

ImageUrl::New() // refcount : 1
ImageVisual::Initialize() // refcount : 2
~ImageVisual
 - RemoveExternalTexture("dali://2"); // refcount : 1
 - RequestRemove(2) // still refcount : 1
~ImageUrl // now, refcount : 0
ImageVisual()
LoadTexture() //< New generated texture will use TextureId as 2, with refcount 1

== Process() ==

Remove(2) // Now, TextureId 2's refcount is 0! load cancel.

This patch make we only remove normal texture cache, instead of ExternalResource

Change-Id: Ia735770a02c231fa79af40a1e5926aab11358b71
Signed-off-by: jmm <j0064423.lee@samsung.com>
automated-tests/src/dali-toolkit-internal/utc-Dali-TextureManager.cpp
dali-toolkit/internal/texture-manager/texture-manager-impl.cpp