-
Notifications
You must be signed in to change notification settings - Fork 4
Gendarme.Rules.Performance.RemoveUnneededFinalizerRule(git)
Assembly: Gendarme.Rules.Performance
Version: git
This rule looks for types that have an empty finalizer (a.k.a. destructor in C# or Finalize method). Finalizers that simply set fields to null are considered to be empty because this does not help the garbage collection. You should remove the empty finalizer to alleviate pressure on the garbage collector and finalizer thread.
Bad example (empty):
class Bad {
~Bad ()
{
}
}
Bad example (only nulls fields):
class Bad {
object o;
~Bad ()
{
o = null;
}
}
Good example:
class Good {
object o;
}
- Prior to Gendarme 2.2 this rule was named EmptyDestructorRule
You can browse the latest source code of this rule on github.com
Note that this page was autogenerated (3/17/2011 1:55:44 PM) based on the xmldoc
comments inside the rules source code and cannot be edited from this wiki.
Please report any documentation errors, typos or suggestions to the
Gendarme Mailing List. Thanks!