Skip to content
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

[API10][NUI][AT-SPI] Detach NUIViewAccessible in View.Dispose() #5663

Merged
merged 1 commit into from
Oct 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/Tizen.NUI/src/internal/Interop/Interop.ControlDevel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -70,9 +70,7 @@ private static T GetInterfaceFromRefObject<T>(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)
Expand Down Expand Up @@ -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;

Expand Down