Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private bool disposed = false;
- ~BaseClass()
- {
- if(!disposed)
- {
- DisposeNative();
- }
- }
- public void Dispose()
- {
- if(!disposed)
- {
- DisposeNative();
- DisposeManaged();
- }
- }
- protected virtual void DisposeNative()
- {
- // Implement this where needed in child classes
- }
- protected virtual void DisposeManaged()
- {
- // Implement this where needed in child classes
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement