Is this locking correct in ModuleDefinition? #951
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
github.com/jbevain/cecil@8e1ae7b4ea/Mono.Cecil/ModuleDefinition.cs (L387-L393)It seems like this sequence of events might be possible, resulting in creation of an DefaultAssemblyResolver instance that's never disposed:
assembly_resolver.value == nullassembly_resolver.value == nulllockblock and setsassembly_resolverto a new instancelockblock and re-setsassembly_resolverto a new instanceThe instance in step 3 is now lost and was never disposed.
I agree, using
if/lock/ifwould be appropriate as it's a standard pattern, or just changing=to??=in this case.