-
Notifications
You must be signed in to change notification settings - Fork 232
Expand file tree
/
Copy pathDisposableObject.cs
More file actions
41 lines (34 loc) · 987 Bytes
/
DisposableObject.cs
File metadata and controls
41 lines (34 loc) · 987 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
//Copyright © 2014 Sony Computer Entertainment America LLC. See License.txt.
using System;
using System.ComponentModel;
namespace RenderingInterop
{
/// <summary>
/// base class for all the non-DomNode native objects.</summary>
public class DisposableObject : IDisposable
{
/// <summary>
/// Gets a value indicating whether the object has been disposed of. </summary>
[Browsable(false)]
public bool IsDisposed
{
get { return m_disposed; }
}
public void Dispose()
{
if (m_disposed) return;
Dispose(true);
m_disposed = true;
GC.SuppressFinalize(this);
}
protected virtual void Dispose(bool disposing)
{
}
~DisposableObject()
{
Dispose(false);
m_disposed = true;
}
private bool m_disposed;
}
}