public static AppleWithRefCounter2 Alloc() { AppleWithRefCounter2 apple = ObjectAllocatorHolder <AppleWithRefCounter2> .Allocate(); return(apple); }
static void TestReferenceCounteredObjectPool2() { AppleWithRefCounter2 apple = AppleWithRefCounter2.Alloc(); apple.ReleaseReference(); // compile will fail, if not release thanks to code analysis }