public StdSharedPtr(T obj) { if (obj == null) { throw new ArgumentNullException(nameof(obj)); } obj.ThrowIfDisposed(); this._Imp = CreateImp(); this.NativePtr = this._Imp.Create(obj.NativePtr); this._Obj = obj; obj.IsEnableDispose = false; }
//public StdSharedPtr() //{ // this._Imp = CreateImp(); // this.NativePtr = this._Imp.Create(); //} public StdSharedPtr(T obj) { if (obj == null) { throw new ArgumentNullException(nameof(obj)); } obj.ThrowIfDisposed(); this._Imp = CreateImp(); this.NativePtr = this._Imp.Create(obj.NativePtr); this._Obj = obj; // set object will be destructed by native domain obj.IsEnableDispose = false; }
internal StdSharedPtr(IntPtr sharedPtr) { this._Imp = CreateImp(); this.NativePtr = sharedPtr; }
internal StdSharedPtr(IntPtr sharedPtr, bool isEnabledDispose = true) : base(isEnabledDispose) { this._Imp = CreateImp(); this.NativePtr = sharedPtr; }