From 8b4a503a44f379e23f49f6adf1eefe4703f1031f Mon Sep 17 00:00:00 2001 From: "Eunki, Hong" Date: Mon, 30 Oct 2023 13:49:51 +0900 Subject: [PATCH] [NUI] Make DaliAccessibilityDetachAccessibleObject called at main thread void Dispose(bool) can be called from worker thread, when disposing value is false. To ensure we detach AccessibileObject in main thread, let we remove it at Dispose(DisposeTypes), instead of Dispose(bool) Signed-off-by: Eunki, Hong --- src/Tizen.NUI/src/public/BaseComponents/LottieAnimationView.cs | 1 + src/Tizen.NUI/src/public/BaseComponents/ViewAccessibility.cs | 3 --- src/Tizen.NUI/src/public/BaseComponents/ViewInternal.cs | 3 +++ 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/Tizen.NUI/src/public/BaseComponents/LottieAnimationView.cs b/src/Tizen.NUI/src/public/BaseComponents/LottieAnimationView.cs index a4447f2adb9..f5e80e4c94f 100755 --- a/src/Tizen.NUI/src/public/BaseComponents/LottieAnimationView.cs +++ b/src/Tizen.NUI/src/public/BaseComponents/LottieAnimationView.cs @@ -103,6 +103,7 @@ protected override void Dispose(DisposeTypes type) [EditorBrowsable(EditorBrowsableState.Never)] protected override void Dispose(bool disposing) { + // Note : We can clean dictionaries even this API called from GC Thread. CleanCallbackDictionaries(); base.Dispose(disposing); } diff --git a/src/Tizen.NUI/src/public/BaseComponents/ViewAccessibility.cs b/src/Tizen.NUI/src/public/BaseComponents/ViewAccessibility.cs index 5dead250943..31756b0216f 100755 --- a/src/Tizen.NUI/src/public/BaseComponents/ViewAccessibility.cs +++ b/src/Tizen.NUI/src/public/BaseComponents/ViewAccessibility.cs @@ -397,9 +397,6 @@ protected override void Dispose(bool disposing) internalName = null; - Interop.ControlDevel.DaliAccessibilityDetachAccessibleObject(SwigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - if (disposing == false) { if (IsNativeHandleInvalid() || SwigCMemOwn == false) diff --git a/src/Tizen.NUI/src/public/BaseComponents/ViewInternal.cs b/src/Tizen.NUI/src/public/BaseComponents/ViewInternal.cs index 93cded688a0..e554c8bc9b7 100755 --- a/src/Tizen.NUI/src/public/BaseComponents/ViewInternal.cs +++ b/src/Tizen.NUI/src/public/BaseComponents/ViewInternal.cs @@ -1346,6 +1346,9 @@ protected override void Dispose(DisposeTypes type) disposeDebugging(type); + Interop.ControlDevel.DaliAccessibilityDetachAccessibleObject(SwigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + //_mergedStyle = null; internalMaximumSize?.Dispose();