summaryrefslogtreecommitdiff
path: root/modules/mono/csharp_script.h
diff options
context:
space:
mode:
authorIgnacio Etcheverry <neikeq@users.noreply.github.com>2018-11-30 21:39:13 +0100
committerGitHub <noreply@github.com>2018-11-30 21:39:13 +0100
commit989b93d6a406d439367bf34fb39b422c0f639f17 (patch)
treef007e28300c91e329e615dea88022b43c2c3d932 /modules/mono/csharp_script.h
parent5b8dde4b4a5a930e08da51e07ec87f43e5bd7b36 (diff)
parentb9b7dcdf001e1705ec45deab56d31eb74dcaaa4d (diff)
Merge pull request #24091 from neikeq/ii
C#: Improve tool script support and fix reloading issues
Diffstat (limited to 'modules/mono/csharp_script.h')
-rw-r--r--modules/mono/csharp_script.h31
1 files changed, 21 insertions, 10 deletions
diff --git a/modules/mono/csharp_script.h b/modules/mono/csharp_script.h
index 871d4d7e4c..c9143587fd 100644
--- a/modules/mono/csharp_script.h
+++ b/modules/mono/csharp_script.h
@@ -82,6 +82,21 @@ class CSharpScript : public Script {
Set<Object *> instances;
+#ifdef DEBUG_ENABLED
+ Set<ObjectID> pending_reload_instances;
+#endif
+
+ struct StateBackup {
+ // TODO
+ // Replace with buffer containing the serialized state of managed scripts.
+ // Keep variant state backup to use only with script instance placeholders.
+ List<Pair<StringName, Variant> > properties;
+ };
+
+#ifdef TOOLS_ENABLED
+ Map<ObjectID, CSharpScript::StateBackup> pending_reload_state;
+#endif
+
String source;
StringName name;
@@ -105,10 +120,6 @@ class CSharpScript : public Script {
virtual void _placeholder_erased(PlaceHolderScriptInstance *p_placeholder);
#endif
-#ifdef DEBUG_ENABLED
- Map<ObjectID, List<Pair<StringName, Variant> > > pending_reload_state;
-#endif
-
Map<StringName, PropertyInfo> member_info;
void _clear();
@@ -186,6 +197,7 @@ class CSharpInstance : public ScriptInstance {
bool base_ref;
bool ref_dying;
bool unsafe_referenced;
+ bool predelete_notified;
Ref<CSharpScript> script;
Ref<MonoGCHandle> gchandle;
@@ -255,11 +267,9 @@ class CSharpLanguage : public ScriptLanguage {
GDMono *gdmono;
SelfList<CSharpScript>::List script_list;
- Mutex *lock;
- Mutex *script_bind_lock;
- Mutex *script_gchandle_release_lock;
-
- Map<Ref<CSharpScript>, Map<ObjectID, List<Pair<StringName, Variant> > > > to_reload;
+ Mutex *script_instances_mutex;
+ Mutex *script_gchandle_release_mutex;
+ Mutex *language_bind_mutex;
Map<Object *, CSharpScriptBinding> script_bindings;
@@ -296,7 +306,8 @@ public:
bool debug_break_parse(const String &p_file, int p_line, const String &p_error);
#ifdef TOOLS_ENABLED
- void reload_assemblies_if_needed(bool p_soft_reload);
+ bool is_assembly_reloading_needed();
+ void reload_assemblies(bool p_soft_reload);
#endif
void project_assembly_loaded();