Skip to content

Commit 6f21740

Browse files
Merge pull request #1334 from mcneel/kike/1.32-merge-1.x
Merge branch 'kike/1.32' into 1.x
2 parents 7c6eb02 + 94a2e28 commit 6f21740

File tree

1 file changed

+11
-8
lines changed

1 file changed

+11
-8
lines changed

src/RhinoInside.Revit/AssemblyResolver.cs

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -149,13 +149,13 @@ internal Assembly ResolveAssembly(AssemblyName requested)
149149
#if DEBUG
150150
Debug.Assert(location.assemblyName.Version >= requested.Version);
151151
#else
152-
if (location.assemblyName.Version < requested.Version)
153-
return default;
152+
if (location.assemblyName.Version < requested.Version)
153+
return default;
154154
#endif
155155

156156
if (location.Assembly is null)
157157
{
158-
// Never load an Internal assembly from an other thread than the UI thread.
158+
// Never load an External assembly from an other thread than the UI thread.
159159
if (ThreadHandle.CurrentThreadId != ExternalThreadId && ExternalReferences.ContainsKey(location.assemblyName.Name))
160160
return default;
161161

@@ -189,13 +189,16 @@ internal Assembly ResolveAssembly(AssemblyName requested)
189189
}
190190
}
191191

192-
if (loadedAssembly is object)
192+
lock (location)
193193
{
194-
try { location.Activate(loadedAssembly); }
195-
catch { }
196-
}
194+
if (loadedAssembly is object)
195+
{
196+
try { location.Activate(loadedAssembly); }
197+
catch { }
198+
}
197199

198-
return location.Assembly;
200+
return location.Assembly;
201+
}
199202
}
200203

201204
#if NET

0 commit comments

Comments
 (0)