// Initialize an object that should be disposed by the user. protected internal void InitializeUserOwned(IntPtr native) { Initialize(native); #if !BULLET_OBJECT_TRACKING IsUserOwned = true; #endif BulletObjectTracker.Add(this); }
// Initialize an object that is part of another object or deleted by another object. // These objects should not be deleted in the Dispose method of this wrapper class. protected internal void InitializeSubObject(IntPtr native, BulletObject owner) { Initialize(native); #if BULLET_OBJECT_TRACKING Owner = owner; #endif BulletObjectTracker.Add(this); GC.SuppressFinalize(this); }
public void Dispose() { if (IsDisposed == false) { Dispose(true); IsDisposed = true; BulletObjectTracker.Remove(this); GC.SuppressFinalize(this); } }