[NUI][API10] Remove DynamicProperty callback if URL changed + Make more thread safe...
authorEunki, Hong <eunkiki.hong@samsung.com>
Mon, 9 Dec 2024 12:34:46 +0000 (21:34 +0900)
committerEunki Hong <h.pichulia@gmail.com>
Tue, 10 Dec 2024 05:59:53 +0000 (14:59 +0900)
commit08e456f70dba0d28301e10a19c1e9f7497f55c59
treee35c2662418acef9f35ecca5cb3d64987f6494ab
parente37dc513ac2e197ec0ae7698d920ed62de1c4ee1
[NUI][API10] Remove DynamicProperty callback if URL changed + Make more thread safe enough

Let us remove DynamicProperty callbacks if URL changes.
So far, we discard the callbacks if visual was changed.
But, the callbacks, which NUI stored, were not removed and remained alive
whenever we changed the URL.

Let us ensure their removal when URL changed (~= Visual Changed)

+

To avoid race condition, let we add lock feature before change `InternalSavedDynamicPropertyCallbacks`
(Since we can access this dictionary from various threads.) and make `weakReferencesOfLottie` as `ConcurrentDictionary` type.

Note : Since we need to iterate by `InternalSavedDynamicPropertyCallbacks.Keys` we need to use lock,
instead of `ConcurrentDictionary`.

TODO : There are some cases where we don't want to destroy registered callbacks. They will remain active in the future.
We make relative sample at `LottieAnimationViewDynamicPropertyTest.cs`. Let we pass `Test4` case show dynmaic property well.

Signed-off-by: Eunki, Hong <eunkiki.hong@samsung.com>
src/Tizen.NUI/src/public/BaseComponents/LottieAnimationView.cs
test/Tizen.NUI.Samples/Tizen.NUI.Samples/Samples/LottieAnimationViewDynamicPropertyTest.cs