Fork me on GitHub
TypeName EmptyFinalizerAnalyzer
Check Id CC0025
Category Design
Severity Warning

Cause

An empty finalizer will stop your object from being collected immediately by the Garbage Collector when no longer used. It will instead be placed in the finalizer queue needlessly using resources.

Example

public class MyClass 
{ 
	~MyClass() 
	{ 
	} 
}

Code fix

A code fix will be presented to you that will transform the code:

public class MyClass 
{ 
}

Code fix

Related rules

None

See also

TBD