checkpoint for real

This commit is contained in:
2020-04-27 12:34:56 -04:00
parent 6ed92261ec
commit c1618deb83
31 changed files with 1429 additions and 626 deletions

View File

@@ -1,4 +1,21 @@
$HEADER$namespace $NAMESPACE$
using System;
using System.Runtime.ConstrainedExecution;
using System.Runtime.InteropServices;
using Foodsoft.Alpm;
namespace Foodsoft.Alpm
{
public class $CLASS$ {$END$}
internal sealed class SafeAlpmHandle : SafeHandle
{
private SafeAlpmHandle() : base(IntPtr.Zero, true) { }
[ReliabilityContract(Consistency.WillNotCorruptState, Cer.MayFail), PrePrepareMethod]
protected override bool ReleaseHandle() => alpm.alpm_release(handle) == 0;
public override bool IsInvalid
{
[ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success), PrePrepareMethod]
get => handle == IntPtr.Zero;
}
}
}