Skip to content

Commit

Permalink
Merge pull request #78787 from RedworkDE/net-non-tool-reload
Browse files Browse the repository at this point in the history
C#: Fix reloading of non-tool scripts
  • Loading branch information
akien-mga authored Jun 28, 2023
2 parents d95b516 + 60b9eb1 commit 9a09ee5
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion modules/mono/csharp_script.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -781,7 +781,8 @@ void CSharpLanguage::reload_assemblies(bool p_soft_reload) {
MutexLock lock(script_instances_mutex);

for (SelfList<CSharpScript> *elem = script_list.first(); elem; elem = elem->next()) {
bool is_reloadable = false;
// Do not reload scripts with only non-collectible instances to avoid disrupting event subscriptions and such.
bool is_reloadable = elem->self()->instances.size() == 0;
for (Object *obj : elem->self()->instances) {
ERR_CONTINUE(!obj->get_script_instance());
CSharpInstance *csi = static_cast<CSharpInstance *>(obj->get_script_instance());
Expand Down

0 comments on commit 9a09ee5

Please sign in to comment.