[NUI] Use weak reference for theme changed event
authorJiyun Yang <ji.yang@samsung.com>
Fri, 20 Nov 2020 08:39:04 +0000 (17:39 +0900)
committerdongsug-song <35130733+dongsug-song@users.noreply.github.com>
Tue, 8 Dec 2020 06:23:12 +0000 (15:23 +0900)
commitac13de8bfe69cd467e1037746b25f829b9325721
tree2374991de06a9676ad1d00ad0d84901ca8c10e89
parent4532298b152dacfa8010d6b304477fc27cf138ab
[NUI] Use weak reference for theme changed event

Previous theme changed event was holding reference of the view for the theme manager's lifetime
unless the view is disposed by calling Dispose() explicitly.
Since the theme manager is a static class, so there might be a change that the view can't get free by GC.
To solve this problem, this patch apply a weak event that uses weak reference for the handler
so that the views are no longer be caught by theme manager.

Signed-off-by: Jiyun Yang <ji.yang@samsung.com>
src/Tizen.NUI/src/internal/WeakEvent.cs [new file with mode: 0644]
src/Tizen.NUI/src/public/BaseComponents/ViewBindableProperty.cs
src/Tizen.NUI/src/public/BaseComponents/ViewInternal.cs
src/Tizen.NUI/src/public/Theme/ThemeManager.cs