Mono: Don't defer call to dispose queue objects when finalizing domain

It's going to be called anyway after `mono_domain_finalize`.
This also prevents crashes, since the MessageQueue singleton could already be freed at this point (see: #15702).
This commit is contained in:
Ignacio Etcheverry 2018-01-26 01:10:21 +01:00
parent 76ec728003
commit 562ec3f5e6

View File

@ -700,7 +700,9 @@ bool _GodotSharp::is_domain_loaded() {
m_queue.push_back(m_inst); \
if (queue_empty) { \
queue_empty = false; \
if (!is_finalizing_domain()) { /* call_deferred may not be safe here */ \
call_deferred("_dispose_callback"); \
} \
}
void _GodotSharp::queue_dispose(MonoObject *p_mono_object, Object *p_object) {