提交 570062d9 编写于 作者: J Jonathan Chambers

Add unity function to clear domain specific fields from thread object, as they...

Add unity function to clear domain specific fields from thread object, as they may hold objects from an unloaded domain.
上级 b37add6a
......@@ -364,6 +364,9 @@ struct _MonoThread {
gpointer unused4;
gpointer unused5;
gpointer unused6;
MonoObject *threadstart;
int managed_id;
MonoObject* principal;
};
typedef struct {
......
......@@ -46,6 +46,7 @@ mono_unity_set_unhandled_exception_handler
mono_unity_class_is_interface
mono_unity_class_is_abstract
mono_backtrace_from_context
mono_unity_thread_clear_domain_fields
;Exports that should have been here, but I dont understand why they're not.
mono_security_enable_core_clr
......
......@@ -8,6 +8,8 @@
#include <mono/metadata/metadata.h>
#include <mono/metadata/tabledefs.h>
#include <mono/metadata/class-internals.h>
#include <mono/metadata/object-internals.h>
#include <mono/metadata/threads.h>
#include <glib.h>
......@@ -143,3 +145,13 @@ unity_mono_install_memory_callbacks(MonoMemoryCallbacks* callbacks)
{
g_mem_set_callbacks (callbacks);
}
void mono_unity_thread_clear_domain_fields (void)
{
/*
we need to clear fields that may reference objects living in non-root appdomain
since the objects will live but their vtables will be destroyed when domain is torn down.
*/
MonoThread* thread = mono_thread_current ();
thread->principal = NULL;
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册