This rule is Obsolete | |
Synopsis: | Avoid empty finalizers |
Language: | C# |
Severity Level: | 3 |
Category: | Object lifecycle |
Description: |
As stated in MSDN, having an empty destructor just causes loss in performance, so should be avoided. Empty destructors should not be used. When a class contains a destructor, an entry is created in the Finalize queue. When the destructor is called, the garbage collector is invoked to process the queue. If the destructor is empty, this just causes a needless loss of performance. |
Literature References: |
MS Programming Destructors |