Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Fix for 3dsMax Python
Importing clr in 3dsMax python, causes the application to crash on
GetTypes from certain assemblies.
  • Loading branch information
dgsantana authored and tonyroberts committed Jan 7, 2016
commit 7d0b83b1861cf310326ac76aa0a9b4c4c39e1f55
20 changes: 13 additions & 7 deletions src/runtime/assemblymanager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
using System.Collections;
using System.Collections.Specialized;
using System.Collections.Generic;
using System.Diagnostics;
using System.Reflection;
using System.Reflection.Emit;

Expand Down Expand Up @@ -57,10 +58,17 @@ internal static void Initialize() {
domain.AssemblyResolve += rhandler;

Assembly[] items = domain.GetAssemblies();
for (int i = 0; i < items.Length; i++) {
Assembly a = items[i];
assemblies.Add(a);
ScanAssembly(a);
foreach (var a in items)
{
try
{
ScanAssembly(a);
assemblies.Add(a);
}
catch (Exception ex)
{
Debug.WriteLine($"Error scaning assembly {a}. {ex}");
}
}
}

Expand Down Expand Up @@ -316,9 +324,7 @@ internal static void ScanAssembly(Assembly assembly) {
for (int n = 0; n < names.Length; n++) {
s = (n == 0) ? names[0] : s + "." + names[n];
if (!namespaces.ContainsKey(s)) {
namespaces.Add(s,
new Dictionary<Assembly, string>()
);
namespaces.Add(s, new Dictionary<Assembly, string>());
}
}
}
Expand Down