79459445

Date: 2025-02-22 10:37:21
Score: 0.5
Natty:
Report link

I have read quite a bit on this topic lately, trying to make sense of it. What I found is:

Dispose and Finalize are functionally separated, although you would normally want them to be linked. You normally want Dispose() to be called when an object is released from memory, even if you forgot to call it yourself.

Therefore it makes sense to create a Finalize() method, and to call Dispose() from it. And then it really makes sense to call SuppressFinalize() from Dispose(), to avoid that it is called twice.

Reasons:
  • Long answer (-0.5):
  • No code block (0.5):
  • Low reputation (0.5):
Posted by: Emil Albert