Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/xwt.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarius Ungureanu <maungu@microsoft.com>2021-05-18 15:02:16 +0300
committerMarius Ungureanu <maungu@microsoft.com>2021-05-18 15:02:16 +0300
commit9cffa4fa0299feeb0bcb4ea8ff498db4677db16b (patch)
tree9adfe71831b8a455785abadde5079c463c8d9578
parent6844ec1ea273c6dd12701b8660765b7a1ed0e546 (diff)
Switch to try/catch for assemblyload hook
-rw-r--r--Xwt.XamMac/Xwt.Mac/NSApplicationInitializer.cs12
1 files changed, 6 insertions, 6 deletions
diff --git a/Xwt.XamMac/Xwt.Mac/NSApplicationInitializer.cs b/Xwt.XamMac/Xwt.Mac/NSApplicationInitializer.cs
index 2bedb742..f8ee7c04 100644
--- a/Xwt.XamMac/Xwt.Mac/NSApplicationInitializer.cs
+++ b/Xwt.XamMac/Xwt.Mac/NSApplicationInitializer.cs
@@ -52,12 +52,9 @@ namespace Xwt.Mac
AppDomain.CurrentDomain.AssemblyLoad += CurrentDomain_AssemblyLoad;
// Manually register all the currently loaded assemblies.
- lock (lockObject)
+ foreach (var assembly in AppDomain.CurrentDomain.GetAssemblies())
{
- foreach (var assembly in AppDomain.CurrentDomain.GetAssemblies())
- {
- Runtime.RegisterAssembly(assembly);
- }
+ Runtime.RegisterAssembly(assembly);
}
}
}
@@ -70,9 +67,12 @@ namespace Xwt.Mac
private static void CurrentDomain_AssemblyLoad (object sender, AssemblyLoadEventArgs args)
{
- lock (lockObject)
+ try
{
Runtime.RegisterAssembly(args.LoadedAssembly);
+ } catch (Exception e)
+ {
+ Console.Error.WriteLine("Error during static registrar initialization load", e);
}
}
}