From: Eunki, Hong Date: Fri, 10 Nov 2023 07:53:52 +0000 (+0900) Subject: [NUI] DetachAccessibleObject at Dispose time well X-Git-Tag: accepted/tizen/8.0/unified/20240613.065534~126 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=73a8119a8d47ac59055600e4ba34096468fb9603;p=platform%2Fcore%2Fcsapi%2Ftizenfx.git [NUI] DetachAccessibleObject at Dispose time well There was several problem when we call DaliAccessibilityDetachAccessibleObject at Dispose(bool) function - It will detach accessibility even if view doesn't owned the handle memory - Dispose(bool) can be called at worker thread (during GC) so we need to check thread here I make to DaliAccessibilityDetachAccessibleObject function at Dispose(DisposeTypes) that we can ensure it called at main thread clearly. Signed-off-by: Eunki, Hong --- diff --git a/src/Tizen.NUI/src/public/BaseComponents/ViewAccessibility.cs b/src/Tizen.NUI/src/public/BaseComponents/ViewAccessibility.cs index 0b9ee80..eabb666 100755 --- a/src/Tizen.NUI/src/public/BaseComponents/ViewAccessibility.cs +++ b/src/Tizen.NUI/src/public/BaseComponents/ViewAccessibility.cs @@ -397,12 +397,6 @@ namespace Tizen.NUI.BaseComponents internalName = null; - if (SwigCPtr.Handle != IntPtr.Zero && global::System.Threading.Thread.CurrentThread.ManagedThreadId == Registry.Instance.SavedApplicationThread.ManagedThreadId) - { - 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 5e9a007..9e68a77 100755 --- a/src/Tizen.NUI/src/public/BaseComponents/ViewInternal.cs +++ b/src/Tizen.NUI/src/public/BaseComponents/ViewInternal.cs @@ -1346,6 +1346,12 @@ namespace Tizen.NUI.BaseComponents disposeDebugging(type); + if (SwigCMemOwn && !IsNativeHandleInvalid()) + { + Interop.ControlDevel.DaliAccessibilityDetachAccessibleObject(SwigCPtr); + NDalicPINVOKE.ThrowExceptionIfExists(); + } + //_mergedStyle = null; internalMaximumSize?.Dispose();