No, and that could in fact be dangerous and bug-prone (consider the possibility that someone might try to use it later on, not realizing it had been set to null). Only set something to null if there’s a logical reason to set it to null.
More Related Contents:
- What is a NullReferenceException, and how do I fix it?
- Proper use of the IDisposable interface
- Do event handlers stop garbage collection from occurring?
- Unable to cast object of type ‘System.DBNull’ to type ‘System.String`
- Best Practice for Forcing Garbage Collection in C#
- Setting Objects to Null/Nothing after use in .NET
- Implementing IDisposable correctly
- Garbage collector and circular reference
- What is the difference between “x is null” and “x == null”?
- Dispose, when is it called?
- Checking if an object is null in C#
- Does garbage collection run during debug?
- .Net and Bitmap not automatically disposed by GC when there is no memory left
- Is it necessary to explicitly remove event handlers in C#
- Does garbage collector call Dispose()? [duplicate]
- GC.Collect()
- Monitoring Garbage Collector in C#
- Shortest way to check for null and assign another value if not
- How can I write a unit test to determine whether an object can be garbage collected?
- Why is there a difference in checking null against a value in VB.NET and C#?
- How to do ToString for a possibly null object?
- What is IDisposable for?
- Timer, event and garbage collection : am I missing something?
- String.IsNullOrWhiteSpace in LINQ Expression
- Nullable types: better way to check for null or zero in c#
- string.Empty vs null.Which one do you use?
- Does WeakReference make a good cache?
- How are String and Char types stored in memory in .NET?
- Force garbage collection of arrays, C#
- What is the operator precedence of C# null-coalescing (??) operator?