There was a crash issue when disconnecting from signals from any class derived from View. This was due to the fact that the handle has been deleted earlier in derived class dispose function.
Change-Id: Ib5c383b82dbd5ddab5010acdb82048fb27737df5
//You should not access any managed member here except static instance.
//because the execution order of Finalizes is non-deterministic.
+ DisConnectFromSignals();
+
+ if (swigCPtr.Handle != global::System.IntPtr.Zero)
+ {
+ if (swigCMemOwn)
+ {
+ swigCMemOwn = false;
+ NDalicPINVOKE.delete_Scrollable(swigCPtr);
+ }
+ swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
+ }
+
+ base.Dispose(type);
+ }
+
+ private void DisConnectFromSignals()
+ {
+ // Save current CPtr.
+ global::System.Runtime.InteropServices.HandleRef currentCPtr = swigCPtr;
+
+ // Use BaseHandle CPtr as current might have been deleted already in derived classes.
+ swigCPtr = GetBaseHandleCPtrHandleRef;
+
if (_scrollableCompletedCallbackDelegate != null)
{
this.ScrollCompletedSignal().Disconnect(_scrollableCompletedCallbackDelegate);
this.ScrollStartedSignal().Disconnect(_scrollableStartedCallbackDelegate);
}
- if (swigCPtr.Handle != global::System.IntPtr.Zero)
- {
- if (swigCMemOwn)
- {
- swigCMemOwn = false;
- NDalicPINVOKE.delete_Scrollable(swigCPtr);
- }
- swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
- }
-
- base.Dispose(type);
+ // BaseHandle CPtr is used in Registry and there is danger of deletion if we keep using it here.
+ // Restore current CPtr.
+ swigCPtr = currentCPtr;
}
public class StartedEventArgs : EventArgs
//You should not access any managed member here except static instance.
//because the execution order of Finalizes is non-deterministic.
+ DisConnectFromSignals();
+
+ if (swigCPtr.Handle != global::System.IntPtr.Zero)
+ {
+ if (swigCMemOwn)
+ {
+ swigCMemOwn = false;
+ NDalicPINVOKE.delete_View(swigCPtr);
+ }
+ swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
+ }
+
+ base.Dispose(type);
+ }
+
+ private void DisConnectFromSignals()
+ {
+ // Save current CPtr.
+ global::System.Runtime.InteropServices.HandleRef currentCPtr = swigCPtr;
+
+ // Use BaseHandle CPtr as current might have been deleted already in derived classes.
+ swigCPtr = GetBaseHandleCPtrHandleRef;
+
if (_onRelayoutEventCallback != null)
{
this.OnRelayoutSignal().Disconnect(_onRelayoutEventCallback);
this.KeyInputFocusGainedSignal().Disconnect(_keyInputFocusGainedCallback);
}
- if (swigCPtr.Handle != global::System.IntPtr.Zero)
- {
- if (swigCMemOwn)
- {
- swigCMemOwn = false;
- NDalicPINVOKE.delete_View(swigCPtr);
- }
- swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
- }
-
- base.Dispose(type);
+ // BaseHandle CPtr is used in Registry and there is danger of deletion if we keep using it here.
+ // Restore current CPtr.
+ swigCPtr = currentCPtr;
}
private EventHandler _keyInputFocusGainedEventHandler;
return ret;
}
+ internal global::System.Runtime.InteropServices.HandleRef GetBaseHandleCPtrHandleRef
+ {
+ get
+ {
+ return swigCPtr;
+ }
+ }
+
}
}
//You should not access any managed member here except static instance.
//because the execution order of Finalizes is non-deterministic.
+ DisConnectFromSignals();
+
+ if (swigCPtr.Handle != global::System.IntPtr.Zero)
+ {
+ if (swigCMemOwn)
+ {
+ swigCMemOwn = false;
+ NDalicPINVOKE.delete_Button(swigCPtr);
+ }
+ swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
+ }
+
+ base.Dispose(type);
+ }
+
+ private void DisConnectFromSignals()
+ {
+ // Save current CPtr.
+ global::System.Runtime.InteropServices.HandleRef currentCPtr = swigCPtr;
+
+ // Use BaseHandle CPtr as current might have been deleted already in derived classes.
+ swigCPtr = GetBaseHandleCPtrHandleRef;
+
if (_stateChangedCallback != null)
{
StateChangedSignal().Disconnect(_stateChangedCallback);
ClickedSignal().Disconnect(_clickedCallback);
}
- if (swigCPtr.Handle != global::System.IntPtr.Zero)
- {
- if (swigCMemOwn)
- {
- swigCMemOwn = false;
- NDalicPINVOKE.delete_Button(swigCPtr);
- }
- swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
- }
-
- base.Dispose(type);
+ // BaseHandle CPtr is used in Registry and there is danger of deletion if we keep using it here.
+ // Restore current CPtr.
+ swigCPtr = currentCPtr;
}