Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[NUI][API12] Remove DynamicProperty callback if URL changed + Make more thread safe enough #6506

Merged
merged 1 commit into from
Dec 10, 2024

Conversation

hinohie
Copy link
Contributor

@hinohie hinohie commented Dec 10, 2024

This PR is cherry-pick of #6504

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.

…re 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 <[email protected]>
@github-actions github-actions bot added the API12 Platform : Tizen 9.0 / TFM: net6.0-tizen9.0 label Dec 10, 2024
@hinohie hinohie merged commit 984d085 into Samsung:API12 Dec 10, 2024
3 checks passed
@hinohie hinohie deleted the dynamic_bug_api12 branch December 10, 2024 05:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API12 Platform : Tizen 9.0 / TFM: net6.0-tizen9.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants