swigCMemOwn = cMemoryOwn;
swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
+ // using copy constructor to create another native handle so Registry.Unregister works fine.
+ swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, NDalicPINVOKE.new_BaseHandle__SWIG_2(swigCPtr));
+
+ // Register this instance of BaseHandle in the registry.
+ Registry.Register(this);
+ }
+
+ internal BaseHandle(global::System.IntPtr cPtr)
+ {
+ swigCMemOwn = true;
+ swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
+
// Register this instance of BaseHandle in the registry.
Registry.Register(this);
}
if (swigCPtr.Handle != global::System.IntPtr.Zero)
{
- if (swigCMemOwn)
- {
- swigCMemOwn = false;
- NDalicPINVOKE.delete_BaseHandle(swigCPtr);
- }
+ swigCMemOwn = false;
+ NDalicPINVOKE.delete_BaseHandle(swigCPtr);
swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
}
}
- public BaseHandle() : this(NDalicPINVOKE.new_BaseHandle__SWIG_1(), true)
+ public BaseHandle() : this(NDalicPINVOKE.new_BaseHandle__SWIG_1())
{
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
- public BaseHandle(BaseHandle handle) : this(NDalicPINVOKE.new_BaseHandle__SWIG_2(BaseHandle.getCPtr(handle)), true)
+ public BaseHandle(BaseHandle handle) : this(NDalicPINVOKE.new_BaseHandle__SWIG_2(BaseHandle.getCPtr(handle)))
{
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}