sketch of reservation support

This commit is contained in:
Chris Forbes
2009-12-31 10:42:26 +13:00
parent e62c281019
commit c981739b21
7 changed files with 93 additions and 8 deletions

View File

@@ -0,0 +1,28 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace OpenRa
{
public class DisposableAction : IDisposable
{
public DisposableAction(Action a) { this.a = a; }
Action a;
bool disposed;
public void Dispose()
{
if (disposed) return;
disposed = true;
a();
GC.SuppressFinalize(this);
}
~DisposableAction()
{
Dispose();
}
}
}