mirror of
https://github.com/aharabada/glitchy-engine-beef.git
synced 2026-09-05 13:01:52 +00:00
22 lines
445 B
Beef
22 lines
445 B
Beef
using System;
|
|
|
|
namespace GlitchyEngine.Core
|
|
{
|
|
/**
|
|
* Provides a reference counter that, when reaching 0, automatically deletes itself.
|
|
* Implements the IDisposable interface so that it can be used with a using-Block so that the counter
|
|
* will be decremented automatically after leaving the block.
|
|
*/
|
|
public class RefCounter : RefCounted, IDisposable
|
|
{
|
|
protected ~this()
|
|
{
|
|
}
|
|
|
|
public void Dispose()
|
|
{
|
|
ReleaseRef();
|
|
}
|
|
}
|
|
}
|