There were several problems when we call DaliAccessibilityDetachAccessibleObject
at Dispose(bool) function
- It will detach accessibility even if view doesn't own the handle memory
- Dispose(bool) can be called at worker thread (during GC) so we need to check thread here
Make to `DaliAccessibilityDetachAccessibleObject` function at Dispose(DisposeTypes)
so that we can ensure it called at main thread clearly.
Signed-off-by: Eunki, Hong <eunkiki.hong@samsung.com>
Co-authored-by: Eunki, Hong <eunkiki.hong@samsung.com>
}
protected static SWIGExceptionHelper swigExceptionHelper = new SWIGExceptionHelper();
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ internal static void ThrowExceptionIfExists()
+ {
+ if (SWIGPendingException.Pending) throw SWIGPendingException.Retrieve();
+ }
+
+ [System.Diagnostics.Conditional("DEBUG")]
+ internal static void ThrowExceptionIfExistsDebug()
+ {
+ if (SWIGPendingException.Pending) throw SWIGPendingException.Retrieve();
+ }
+
/// <since_tizen> 3 </since_tizen>
public class SWIGPendingException
{
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)
disposeDebugging(type);
+ if (SwigCMemOwn && !IsNativeHandleInvalid())
+ {
+ Interop.ControlDevel.DaliAccessibilityDetachAccessibleObject(SwigCPtr);
+ NDalicPINVOKE.ThrowExceptionIfExists();
+ }
+
//_mergedStyle = null;
internalMaximumSize?.Dispose();