checkpoint
This commit is contained in:
@@ -1,30 +1,15 @@
|
||||
using System;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.ConstrainedExecution;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace Foodsoft.Alpm
|
||||
{
|
||||
internal sealed class SafeCachePackageHandle : SafePackageHandle
|
||||
{
|
||||
internal SafeAlpmHandle SafeAlpmHandle
|
||||
{
|
||||
[ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success)]
|
||||
[PrePrepareMethod]
|
||||
get => SafeDatabaseHandle.SafeAlpmHandle;
|
||||
}
|
||||
|
||||
internal SafeDatabaseHandle SafeDatabaseHandle
|
||||
{
|
||||
[ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success)]
|
||||
[PrePrepareMethod]
|
||||
get;
|
||||
} = null!;
|
||||
|
||||
[ReliabilityContract(Consistency.WillNotCorruptState, Cer.MayFail)]
|
||||
[PrePrepareMethod]
|
||||
internal SafeCachePackageHandle(IntPtr ptr, SafeDatabaseHandle parentHandle)
|
||||
: base()
|
||||
: base(parentHandle.SafeAlpmHandle)
|
||||
{
|
||||
var success = false;
|
||||
|
||||
@@ -43,6 +28,15 @@ namespace Foodsoft.Alpm
|
||||
if (!success) throw new ObjectDisposedException(GetType().FullName);
|
||||
}
|
||||
|
||||
internal SafeDatabaseHandle SafeDatabaseHandle
|
||||
{
|
||||
[ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success)]
|
||||
[PrePrepareMethod]
|
||||
get;
|
||||
} = null!;
|
||||
|
||||
[ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success)]
|
||||
[PrePrepareMethod]
|
||||
protected override bool ReleaseHandle()
|
||||
{
|
||||
SafeDatabaseHandle.DangerousRelease();
|
||||
|
||||
Reference in New Issue
Block a user