Skip to content

Commit

Permalink
Merge pull request #16073 from neikeq/AaaaHH
Browse files Browse the repository at this point in the history
Mono: Don't defer call to dispose queue objects when finalizing domain
  • Loading branch information
akien-mga authored Jan 26, 2018
2 parents 76ec728 + 562ec3f commit a98e949
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions modules/mono/mono_gd/gd_mono.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -696,11 +696,13 @@ bool _GodotSharp::is_domain_loaded() {
return GDMono::get_singleton()->get_scripts_domain() != NULL;
}

#define ENQUEUE_FOR_DISPOSAL(m_queue, m_inst) \
m_queue.push_back(m_inst); \
if (queue_empty) { \
queue_empty = false; \
call_deferred("_dispose_callback"); \
#define ENQUEUE_FOR_DISPOSAL(m_queue, m_inst) \
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) {
Expand Down

0 comments on commit a98e949

Please sign in to comment.