ManagedCallable: use delegate target instead of middleman when possible
If the delegate target is an Object, the connected signal will be registered in that object instead of the middleman. So when that object is destroyed, the signal will be properly disconnected.
This commit is contained in:
@ -40,6 +40,7 @@
|
||||
class ManagedCallable : public CallableCustom {
|
||||
friend class CSharpLanguage;
|
||||
GCHandleIntPtr delegate_handle;
|
||||
ObjectID object_id;
|
||||
|
||||
#ifdef GD_MONO_HOT_RELOAD
|
||||
SelfList<ManagedCallable> self_instance = this;
|
||||
@ -66,7 +67,7 @@ public:
|
||||
|
||||
void release_delegate_handle();
|
||||
|
||||
ManagedCallable(GCHandleIntPtr p_delegate_handle);
|
||||
ManagedCallable(GCHandleIntPtr p_delegate_handle, ObjectID p_object_id);
|
||||
~ManagedCallable();
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user