Is there any need to call
properties.Dispose();
at the end of an event receiver? Would this prevent memory leaks? Is this unnecessary? Is it best practice?
|
Is there any need to call
at the end of an event receiver? Would this prevent memory leaks? Is this unnecessary? Is it best practice? |
||||
|
|
|
No, you don't need to dispose the properties, neither you need to dispose the Reason: The How: Let's have a look at the source code of the
Conclusion: So, you don't need to dispose the properties because the You can also see some example event receivers examples on Technet for better guidance |
|||
|
|
|
The best practice for all .Net objects that implement The only exception to this rule is if you are using objects that you did not create. In SharePoint, these are typically objects passed into your code or existing objects such as those off of |
|||
|