diff --git a/src/Tizen.NUI/src/internal/Interop/Interop.ControlDevel.cs b/src/Tizen.NUI/src/internal/Interop/Interop.ControlDevel.cs index 07c3da8c8e9..f002d0ab7c8 100755 --- a/src/Tizen.NUI/src/internal/Interop/Interop.ControlDevel.cs +++ b/src/Tizen.NUI/src/internal/Interop/Interop.ControlDevel.cs @@ -531,6 +531,9 @@ private AccessibilityDelegate() [DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Accessibility_SetAccessibilityDelegate")] public static extern IntPtr DaliAccessibilitySetAccessibilityDelegate(IntPtr arg1_accessibilityDelegate, uint arg2_accessibilityDelegateSize); + + [DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Accessibility_DetachAccessibleObject")] + public static extern void DaliAccessibilityDetachAccessibleObject(HandleRef arg1_control); } } } diff --git a/src/Tizen.NUI/src/public/BaseComponents/ViewAccessibility.cs b/src/Tizen.NUI/src/public/BaseComponents/ViewAccessibility.cs index 1776e7c7499..41dbd50850d 100755 --- a/src/Tizen.NUI/src/public/BaseComponents/ViewAccessibility.cs +++ b/src/Tizen.NUI/src/public/BaseComponents/ViewAccessibility.cs @@ -377,6 +377,9 @@ 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/ViewAccessibilityWrappers.cs b/src/Tizen.NUI/src/public/BaseComponents/ViewAccessibilityWrappers.cs index 5404598dd24..6b48d1ce160 100644 --- a/src/Tizen.NUI/src/public/BaseComponents/ViewAccessibilityWrappers.cs +++ b/src/Tizen.NUI/src/public/BaseComponents/ViewAccessibilityWrappers.cs @@ -53,7 +53,7 @@ private static View GetViewFromRefObject(IntPtr refObjectPtr) if (view is null) { - NUILog.Error($"RefObject 0x{refObjectPtr:x} is not a View"); + throw new ArgumentException($"RefObject 0x{refObjectPtr:x} is not a View", nameof(refObjectPtr)); } return view; @@ -70,9 +70,7 @@ private static T GetInterfaceFromRefObject(IntPtr refObjectPtr) return atspiInterface; } - NUILog.Error($"RefObject 0x{refObjectPtr:x} is not a {typeof(T).FullName}"); - - return default(T); + throw new ArgumentException($"RefObject 0x{refObjectPtr:x} is not a {typeof(T).FullName}", nameof(refObjectPtr)); } private static IntPtr DuplicateString(string value) @@ -113,8 +111,6 @@ private static void InitializeAccessibilityDelegateAccessibleInterface() private static ulong AccessibilityCalculateStatesWrapper(IntPtr self, ulong initialStates) { View view = GetViewFromRefObject(self); - if (view == null) - return 0UL; ulong bitMask = 0UL;