Example #1
0
        protected override bool ReleaseHandle()
        {
            _deleteInstance(this.handle);

            //makes GC live easier
            _newInstance = null;
            _deleteInstance = null;
            return true;
        }
Example #2
0
        public DatabaseHandle(LibraryHandle libraryHandle)
            : base(true)
        {
            LibraryHandle = libraryHandle;
            _newInstance = libraryHandle.GetUnmanagedDelegate<NewInstanceDelegate>();
            _deleteInstance = libraryHandle.GetUnmanagedDelegate<DeleteInstanceDelegate>();

            this.handle = _newInstance(LibraryHandle);

            if (IsInvalid)
            {
                throw new EjdbException("Unable to create ejdb instance");
            }
        }