File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -111,7 +111,6 @@ public bool IsDisposed
111111 /// ------------------------------------------------------------------------------------
112112 ~ ArrayPtr ( )
113113 {
114- //if (this != s_null) // TODO (Hasso) 2016.11: is this the only place this ugly hack is needed?
115114 Dispose ( false ) ;
116115 // The base class finalizer is called automatically.
117116 }
@@ -150,8 +149,8 @@ public void Dispose()
150149 /// ------------------------------------------------------------------------------------
151150 protected virtual void Dispose ( bool disposing )
152151 {
153- // If you're getting this line it means that you forgot to call Dispose() .
154- Debug . WriteLineIf ( ! disposing , // && this != s_Null, // TODO (Hasso) 2016.11: is this the only place this ugly hack is needed?
152+ // Only warn for finalized instances that actually own allocated memory .
153+ Debug . WriteLineIf ( ! disposing && m_ownMemory ,
155154 "****** Missing Dispose() call for " + GetType ( ) . Name + ". ****** " ) ;
156155
157156 // Must not be run more than once.
You can’t perform that action at this time.
0 commit comments