* Copyright 2001-2003 Ximian, Inc (http://www.ximian.com)
* Copyright 2004-2009 Novell, Inc (http://www.novell.com)
* Copyright 2012 Xamarin Inc
+ * Licensed under the MIT license. See LICENSE file in the project root for full license information.
*/
#undef ASSEMBLY_LOAD_DEBUG
#include <config.h>
void
ves_icall_System_AppDomain_InternalUnload (gint32 domain_id)
{
+ MonoException *exc = NULL;
MonoDomain * domain = mono_domain_get_by_id (domain_id);
if (NULL == domain) {
- MonoException *exc = mono_get_exception_execution_engine ("Failed to unload domain, domain id not found");
+ mono_get_exception_execution_engine ("Failed to unload domain, domain id not found");
mono_set_pending_exception (exc);
return;
}
return;
#endif
- mono_domain_unload (domain);
+ mono_domain_try_unload (domain, (MonoObject**)&exc);
+ if (exc)
+ mono_set_pending_exception (exc);
}
gboolean
{
MonoObject *exc = NULL;
mono_domain_try_unload (domain, &exc);
- if (exc)
- mono_raise_exception ((MonoException*)exc);
}
static guint32