Reloading script triggered a problem, that this hopefully will fix: When
a lua script is reloaded its removed + loaded. When removing the script
it sends out InternalDependencyRemoved and if one or more instance isn't
used it will shut down. However if the instance didnt process that event
yet (so still running, but soon will stop) and the new script checks if
the instance is available (which it is) and a moment later the instance
would process the event and shut down, leaving the script with a missing
instance - aka it would be broken in some way.
With this change it will wait for a bit (at least 10 seconds), before
shutting down, so when reloading there is plenty of time to load the
script again without instances shutting down.
Reloading script triggered a problem, that this hopefully will fix: When a lua script is reloaded its removed + loaded. When removing the script it sends out InternalDependencyRemoved and if one or more instance isn't used it will shut down. However if the instance didnt process that event yet (so still running, but soon will stop) and the new script checks if the instance is available (which it is) and a moment later the instance would process the event and shut down, leaving the script with a missing instance - aka it would be broken in some way.
With this change it will wait for a bit (at least 10 seconds), before shutting down, so when reloading there is plenty of time to load the script again without instances shutting down.