Cpp2IL icon indicating copy to clipboard operation
Cpp2IL copied to clipboard

Managed Function calls pick IDisposable#Dispose a lot

Open SamboyCoding opened this issue 4 years ago • 0 comments

Most noticeable with IEnumerator instances being created - instead of a call to the constructor being emitted, it's often replaced with a call to IDisposable.Dispose, because IEnumerator implements IDisposable.

When there are multiple methods sharing an empty body, we have to use context clues. For example in this case, it's just after a newobj instruction, so it's obviously going to be a constructor call.

SamboyCoding avatar Nov 20 '21 14:11 SamboyCoding