| 1338 | } |
| 1339 | |
| 1340 | void *CSharpLanguage::get_instance_binding_with_setup(Object *p_object) { |
| 1341 | void *binding = get_instance_binding(p_object); |
| 1342 | |
| 1343 | // Initially this was in `_instance_binding_create_callback`. However, after the new instance |
| 1344 | // binding re-write it was resulting in a deadlock in `_instance_binding_reference`, as |
| 1345 | // `setup_csharp_script_binding` may call `reference()`. It was moved here outside to fix that. |
| 1346 | |
| 1347 | if (binding) { |
| 1348 | CSharpScriptBinding &script_binding = ((RBMap<Object *, CSharpScriptBinding>::Element *)binding)->value(); |
| 1349 | |
| 1350 | if (!script_binding.inited) { |
| 1351 | MutexLock lock(CSharpLanguage::get_singleton()->get_language_bind_mutex()); |
| 1352 | |
| 1353 | if (!script_binding.inited) { // Another thread may have set it up |
| 1354 | CSharpLanguage::get_singleton()->setup_csharp_script_binding(script_binding, p_object); |
| 1355 | } |
| 1356 | } |
| 1357 | } |
| 1358 | |
| 1359 | return binding; |
| 1360 | } |
| 1361 | |
| 1362 | void *CSharpLanguage::get_existing_instance_binding(Object *p_object) { |
| 1363 | #ifdef DEBUG_ENABLED |
nothing calls this directly
no test coverage detected