//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)
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);
+ }
+
+ if (_scrollableUpdatedCallbackDelegate != null)
+ {
+ this.ScrollUpdatedSignal().Disconnect(_scrollableUpdatedCallbackDelegate);
+ }
+
+ if (_scrollableStartedCallbackDelegate != null)
+ {
+ this.ScrollStartedSignal().Disconnect(_scrollableStartedCallbackDelegate);
+ }
+
+ // 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
{
private Vector2 _vector2;