The application may crash if the View is disposed but the Accessibility
infrastructure calls one of the View methods. Detaching the
NUIViewAccessible proxy object in View.Dispose() should prevent that.
[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);
}
}
}
internalName = null;
+ Interop.ControlDevel.DaliAccessibilityDetachAccessibleObject(SwigCPtr);
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+
if (disposing == false)
{
if (IsNativeHandleInvalid() || SwigCMemOwn == false)
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;
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)
private static ulong AccessibilityCalculateStatesWrapper(IntPtr self, ulong initialStates)
{
View view = GetViewFromRefObject(self);
- if (view == null)
- return 0UL;
ulong bitMask = 0UL;