Skip to content

Commit 2cffa15

Browse files
authored
Merge pull request #540 from CreateAndInject/Clean-moduleSearchPaths
Clean moduleSearchPaths
2 parents 3426764 + 9247e2c commit 2cffa15

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/DotNet/AssemblyResolver.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -336,6 +336,8 @@ public bool Remove(AssemblyDef asm) {
336336
#if THREAD_SAFE
337337
theLock.EnterWriteLock(); try {
338338
#endif
339+
if (asm.ManifestModule is { } module)
340+
moduleSearchPaths.Remove(module);
339341
return cachedAssemblies.Remove(asmKey);
340342
#if THREAD_SAFE
341343
} finally { theLock.ExitWriteLock(); }
@@ -355,6 +357,7 @@ public void Clear() {
355357
#endif
356358
asms = new List<AssemblyDef>(cachedAssemblies.Values);
357359
cachedAssemblies.Clear();
360+
moduleSearchPaths.Clear();
358361
#if THREAD_SAFE
359362
} finally { theLock.ExitWriteLock(); }
360363
#endif

0 commit comments

Comments
 (0)