summaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2019-07-05 10:29:19 +0200
committerGitHub <noreply@github.com>2019-07-05 10:29:19 +0200
commit6e9cb44004b8bd30a5834d06671ccd1c62508bfe (patch)
treee3086f5a8a133dc0630e6f5e4b7065e174977df3 /core
parenta149e412f75e9eef87e8ff54e21402f90161f65b (diff)
parent0639946c72ba6632bc3b0953d64f644af328e5e6 (diff)
Merge pull request #30282 from neikeq/editor_in_cs_equals_win
Re-write mono module editor code in C#
Diffstat (limited to 'core')
-rw-r--r--core/project_settings.cpp4
-rw-r--r--core/reference.cpp4
2 files changed, 6 insertions, 2 deletions
diff --git a/core/project_settings.cpp b/core/project_settings.cpp
index 584b75b026..3597e2b818 100644
--- a/core/project_settings.cpp
+++ b/core/project_settings.cpp
@@ -83,6 +83,10 @@ String ProjectSettings::localize_path(const String &p_path) const {
// `plus_file("")` is an easy way to ensure we have a trailing '/'.
const String res_path = resource_path.plus_file("");
+ // DirAccess::get_current_dir() is not guaranteed to return a path that with a trailing '/',
+ // so we must make sure we have it as well in order to compare with 'res_path'.
+ cwd = cwd.plus_file("");
+
if (!cwd.begins_with(res_path)) {
return p_path;
};
diff --git a/core/reference.cpp b/core/reference.cpp
index 7b5145184a..1984af9a34 100644
--- a/core/reference.cpp
+++ b/core/reference.cpp
@@ -70,7 +70,7 @@ bool Reference::reference() {
if (get_script_instance()) {
get_script_instance()->refcount_incremented();
}
- if (instance_binding_count > 0) {
+ if (instance_binding_count > 0 && !ScriptServer::are_languages_finished()) {
for (int i = 0; i < MAX_SCRIPT_INSTANCE_BINDINGS; i++) {
if (_script_instance_bindings[i]) {
ScriptServer::get_language(i)->refcount_incremented_instance_binding(this);
@@ -91,7 +91,7 @@ bool Reference::unreference() {
bool script_ret = get_script_instance()->refcount_decremented();
die = die && script_ret;
}
- if (instance_binding_count > 0) {
+ if (instance_binding_count > 0 && !ScriptServer::are_languages_finished()) {
for (int i = 0; i < MAX_SCRIPT_INSTANCE_BINDINGS; i++) {
if (_script_instance_bindings[i]) {
bool script_ret = ScriptServer::get_language(i)->refcount_decremented_instance_binding(this);