public unsafe void CheckShutdownFrees() { // (because of PlayerConnectionTestFixture.PerTestSetUp) MessageStreamManager.DestroyStreamBuilder(messageBuilder); // Kill any buffers already registered from the profiler system MessageStreamManager.Shutdown(); long sizePreInit = UnsafeUtility.GetHeapSize(Collections.Allocator.Persistent); // Start fresh MessageStreamManager.Initialize(); // The pointers returned by these 2 methods will get lost surely... MessageStreamManager.CreateStreamBuilder(); MessageStreamManager.CreateStreamBuilder(); long sizeCreate = UnsafeUtility.GetHeapSize(Collections.Allocator.Persistent); MessageStreamManager.Shutdown(); long sizeShutdown = UnsafeUtility.GetHeapSize(Collections.Allocator.Persistent); // (because of PlayerConnectionTestFixture.PerTestTearDown) // (also do this prior to asserts in case of test failure so tear down doesn't fail and we miss the real issue) MessageStreamManager.Initialize(); messageBuilder = MessageStreamManager.CreateStreamBuilder(); Assert.IsTrue(sizePreInit < sizeCreate); Assert.IsTrue(sizePreInit == sizeShutdown); }
public static void ShutdownMessageStreamManager() { MessageStreamManager.Shutdown(); }