1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-18 14:21:41 +00:00

Add -Wshadow=local to warnings and fix reported issues.

Fixes #25316.
This commit is contained in:
marxin
2019-02-12 21:10:08 +01:00
committed by Rémi Verschelde
parent 132e2f458d
commit 8d51618949
134 changed files with 1107 additions and 1110 deletions

View File

@@ -75,14 +75,14 @@ void tie_managed_to_unmanaged(MonoObject *managed, Object *unmanaged) {
script_binding.wrapper_class = klass;
script_binding.gchandle = MonoGCHandle::create_strong(managed);
Reference *ref = Object::cast_to<Reference>(unmanaged);
if (ref) {
Reference *kref = Object::cast_to<Reference>(unmanaged);
if (kref) {
// Unsafe refcount increment. The managed instance also counts as a reference.
// This way if the unmanaged world has no references to our owner
// but the managed instance is alive, the refcount will be 1 instead of 0.
// See: godot_icall_Reference_Dtor(MonoObject *p_obj, Object *p_ptr)
ref->reference();
kref->reference();
}
// The object was just created, no script instance binding should have been attached
@@ -96,8 +96,7 @@ void tie_managed_to_unmanaged(MonoObject *managed, Object *unmanaged) {
return;
}
Ref<MonoGCHandle> gchandle = ref ? MonoGCHandle::create_weak(managed) :
MonoGCHandle::create_strong(managed);
Ref<MonoGCHandle> gchandle = ref ? MonoGCHandle::create_weak(managed) : MonoGCHandle::create_strong(managed);
Ref<CSharpScript> script = CSharpScript::create_for_managed_type(klass, native);