1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-05 12:10:55 +00:00

Merge pull request #12549 from neikeq/seriously-do-they

Mono cleanup fixes
This commit is contained in:
Ignacio Etcheverry
2017-11-01 01:56:16 +01:00
committed by GitHub
4 changed files with 22 additions and 3 deletions

View File

@@ -122,6 +122,9 @@ void CSharpLanguage::init() {
void CSharpLanguage::finish() {
// Release gchandle bindings before finalizing mono runtime
gchandle_bindings.clear();
if (gdmono) {
memdelete(gdmono);
gdmono = NULL;
@@ -827,6 +830,14 @@ void *CSharpLanguage::alloc_instance_binding_data(Object *p_object) {
void CSharpLanguage::free_instance_binding_data(void *p_data) {
if (GDMono::get_singleton() == NULL) {
#ifdef DEBUG_ENABLED
CRASH_COND(!gchandle_bindings.empty());
#endif
// Mono runtime finalized, all the gchandle bindings were already released
return;
}
#ifndef NO_THREADS
script_bind_lock->lock();
#endif