mirror of
https://github.com/godotengine/godot.git
synced 2025-10-20 00:13:30 +00:00
Make sure gchandle bindings are released before cleanup
This commit is contained in:
parent
a4ea63737c
commit
06ea441564
2 changed files with 15 additions and 0 deletions
|
@ -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;
|
||||
|
@ -794,6 +797,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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue