This consists in executing the callback synchronously and swallowing any exception in this callback.
async_result.Invoke ();
if (completed && callback != null) {
- ThreadPool.UnsafeQueueCustomWorkItem (new AsyncResult (state => callback ((IAsyncResult) state), this, false), false);
+ try {
+ callback (this);
+ } catch (Exception e) {
+ AppDomain.CurrentDomain.DoUnhandledException (e);
+ }
}
}
DomainUnload(this, null);
}
+ [MethodImplAttribute(MethodImplOptions.InternalCall)]
+ internal extern void DoUnhandledException (Exception e);
+
internal void DoUnhandledException (UnhandledExceptionEventArgs args) {
if (UnhandledException != null)
UnhandledException (this, args);
return mono_domain_is_unloading (domain);
}
+void
+ves_icall_System_AppDomain_DoUnhandledException (MonoException *exc)
+{
+ mono_unhandled_exception ((MonoObject*) exc);
+}
+
gint32
ves_icall_System_AppDomain_ExecuteAssembly (MonoAppDomain *ad,
MonoReflectionAssembly *refass, MonoArray *args)
void
ves_icall_System_AppDomain_InternalUnload (gint32 domain_id);
+void
+ves_icall_System_AppDomain_DoUnhandledException (MonoException *exc);
+
gint32
ves_icall_System_AppDomain_ExecuteAssembly (MonoAppDomain *ad,
MonoReflectionAssembly *refass,
ICALL(KPAIR_5, "_ProtectUser", ves_icall_Mono_Security_Cryptography_KeyPairPersistence_ProtectUser)
#endif /* !PLATFORM_RO_FS */
-ICALL_TYPE(APPDOM, "System.AppDomain", APPDOM_1)
+ICALL_TYPE(APPDOM, "System.AppDomain", APPDOM_23)
+ICALL(APPDOM_23, "DoUnhandledException", ves_icall_System_AppDomain_DoUnhandledException)
ICALL(APPDOM_1, "ExecuteAssembly", ves_icall_System_AppDomain_ExecuteAssembly)
ICALL(APPDOM_2, "GetAssemblies", ves_icall_System_AppDomain_GetAssemblies)
ICALL(APPDOM_3, "GetData", ves_icall_System_AppDomain_GetData)