-
Notifications
You must be signed in to change notification settings - Fork 254
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] Remove DynamicProperty callback if URL changed + Make more thread safe enough #6504
Conversation
Build Error:
|
@hinohie |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please update the build error as Dongsug mentioned
@hinohie |
3823df1
to
4a4ea4f
Compare
Hello @Seoyeon2Kim . Thank you for your comments. I check you change PR message more clear. It looks greate! I applied the comments fix, and more, add some sample relative with this PR, and TODO. |
…ad 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]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool to add more cases :)
Let us remove
DynamicProperty
callbacks if URL changes.So far, we discard the callbacks if the 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 the URL changes (~= Visual Changed)
To avoid race conditions, let's add a lock feature before changing
InternalSavedDynamicPropertyCallbacks
(Since we can access this dictionary from various threads.)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 passTest4
case show dynmaic property well.