summaryrefslogtreecommitdiff
path: root/modules/mono/csharp_script.h
diff options
context:
space:
mode:
Diffstat (limited to 'modules/mono/csharp_script.h')
-rw-r--r--modules/mono/csharp_script.h23
1 files changed, 20 insertions, 3 deletions
diff --git a/modules/mono/csharp_script.h b/modules/mono/csharp_script.h
index 8a09be79a6..db9d6a73a2 100644
--- a/modules/mono/csharp_script.h
+++ b/modules/mono/csharp_script.h
@@ -127,7 +127,7 @@ class CSharpScript : public Script {
bool _update_exports();
#ifdef TOOLS_ENABLED
- bool _get_member_export(GDMonoClass *p_class, GDMonoClassMember *p_member, PropertyInfo &r_prop_info, bool &r_exported);
+ bool _get_member_export(GDMonoClass *p_class, IMonoClassMember *p_member, PropertyInfo &r_prop_info, bool &r_exported);
#endif
CSharpInstance *_create_instance(const Variant **p_args, int p_argcount, Object *p_owner, bool p_isref, Variant::CallError &r_error);
@@ -206,8 +206,15 @@ class CSharpInstance : public ScriptInstance {
Ref<MonoGCHandle> gchandle;
bool _reference_owner_unsafe();
+
+ /*
+ * If true is returned, the caller must memdelete the script instance's owner.
+ */
bool _unreference_owner_unsafe();
+ /*
+ * If NULL is returned, the caller must destroy the script instance by removing it from its owner.
+ */
MonoObject *_internal_new_managed();
// Do not use unless you know what you are doing
@@ -216,13 +223,15 @@ class CSharpInstance : public ScriptInstance {
void _call_multilevel(MonoObject *p_mono_object, const StringName &p_method, const Variant **p_args, int p_argcount);
- MultiplayerAPI::RPCMode _member_get_rpc_mode(GDMonoClassMember *p_member) const;
+ MultiplayerAPI::RPCMode _member_get_rpc_mode(IMonoClassMember *p_member) const;
public:
MonoObject *get_mono_object() const;
_FORCE_INLINE_ bool is_destructing_script_instance() { return destructing_script_instance; }
+ virtual Object *get_owner();
+
virtual bool set(const StringName &p_name, const Variant &p_value);
virtual bool get(const StringName &p_name, Variant &r_ret) const;
virtual void get_property_list(List<PropertyInfo> *p_properties) const;
@@ -235,7 +244,12 @@ public:
virtual void call_multilevel_reversed(const StringName &p_method, const Variant **p_args, int p_argcount);
void mono_object_disposed(MonoObject *p_obj);
- void mono_object_disposed_baseref(MonoObject *p_obj, bool p_is_finalizer, bool &r_owner_deleted);
+
+ /*
+ * If 'r_delete_owner' is set to true, the caller must memdelete the script instance's owner. Otherwise, if
+ * 'r_remove_script_instance' is set to true, the caller must destroy the script instance by removing it from its owner.
+ */
+ void mono_object_disposed_baseref(MonoObject *p_obj, bool p_is_finalizer, bool &r_delete_owner, bool &r_remove_script_instance);
virtual void refcount_incremented();
virtual bool refcount_decremented();
@@ -255,6 +269,7 @@ public:
};
struct CSharpScriptBinding {
+ bool inited;
StringName type_name;
GDMonoClass *wrapper_class;
Ref<MonoGCHandle> gchandle;
@@ -391,6 +406,8 @@ public:
virtual void refcount_incremented_instance_binding(Object *p_object);
virtual bool refcount_decremented_instance_binding(Object *p_object);
+ bool setup_csharp_script_binding(CSharpScriptBinding &r_script_binding, Object *p_object);
+
#ifdef DEBUG_ENABLED
Vector<StackInfo> stack_trace_get_info(MonoObject *p_stack_trace);
#endif