void Destroy() { if (_handle == null) { return; } var handle = _handle; _handle = null; var valid = (_tag != null) && _tag.IsValid(); // Don't crash the finalizer; dont Destroy if parent is deleted if (valid) { _tag.Dispose(); _tag = null; if (_destroyPool) { try { svn_pools.svn_pool_destroy(handle); } catch { } } } }
internal void Clear() { _tag.Ensure(); _tag.Dispose(); _tag = _parent != null ? new AprPoolTag(_parent._tag) : new AprPoolTag(); svn_pools.svn_pool_clear(_handle); }
/// <summary>Creates a childpool within the specified parent pool</summary> public AprPool(AprPool parentPool) { if (parentPool == null) { throw new ArgumentNullException(nameof(parentPool)); } _tag = new AprPoolTag(parentPool._tag); _parent = parentPool; _handle = svn_pools.svn_pool_create(parentPool.Handle); _destroyPool = true; }
/// <summary>Attaches to the specified pool</summary> public AprPool(apr_pool_t handle, bool destroyPool) { _handle = handle ?? throw new ArgumentNullException(nameof(handle)); _tag = new AprPoolTag(); _destroyPool = destroyPool; }
/// <summary>Creates a new root pool</summary> public AprPool() { _tag = new AprPoolTag(); _handle = svn_pools.svn_pool_create(_ultimateParentPool); _destroyPool = true; }
public void Dispose() { _disposed = true; _parent = null; }
public AprPoolTag(AprPoolTag parent) { _parent = parent; }