コード例 #1
0
        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;
        }
コード例 #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;
        }