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;
        }
Example #2
0
        //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;
        }