checkpoint

This commit is contained in:
2020-04-29 23:47:06 -04:00
parent 64f7dd4b7d
commit 19a9fc06ba
31 changed files with 678 additions and 360 deletions

View File

@@ -12,12 +12,11 @@ namespace Foodsoft.Alpm
[ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success)]
[PrePrepareMethod]
get;
} = null!; // we always throw in the constructor on failure
} = null!;
[ReliabilityContract(Consistency.WillNotCorruptState, Cer.MayFail)]
[PrePrepareMethod]
internal SafeDatabaseHandle(IntPtr dbPtr, SafeAlpmHandle safeAlpmHandle)
: base(IntPtr.Zero, true)
internal SafeDatabaseHandle(IntPtr dbPtr, SafeAlpmHandle safeAlpmHandle) : base(IntPtr.Zero, true)
{
var success = false;
@@ -39,8 +38,9 @@ namespace Foodsoft.Alpm
[ReliabilityContract(Consistency.WillNotCorruptState, Cer.MayFail), PrePrepareMethod]
protected override bool ReleaseHandle()
{
var err = alpm.alpm_db_unregister(handle);
SafeAlpmHandle.DangerousRelease();
return true;
return err == 0;
}
public override bool IsInvalid