Browse Source

Edit note on call_deferred() in Singletons (AutoLoad) (#2250)

* Edit note on call_deferred() in Singletons (AutoLoad)

- Rewrote the paragraph to be less wordy and more concise.
- Moved "Object.call_deferred()" to the beginning  of the sentence to emphasize it.

* Specify purpose of call_deferred

Specify purpose of using call_deferred in this context.

(cherry picked from commit 2f27222d160f6360d6210474607711d485f928cd)
Arman 6 years ago
parent
commit
2deb52fa10
1 changed files with 4 additions and 5 deletions
  1. 4 5
      getting_started/step_by_step/singletons_autoload.rst

+ 4 - 5
getting_started/step_by_step/singletons_autoload.rst

@@ -224,11 +224,10 @@ current scene and replace it with the requested one.
         GetTree().SetCurrentScene(CurrentScene);
     }
 
-As mentioned in the comments above, we need to avoid the situation of deleting
-the current scene while it is still being used (i.e. its code is still running),
-so using :ref:`Object.call_deferred() <class_Object_method_call_deferred>`
-is required at this point. The result is that the second function will run
-at a later time when any code from the current scene has completed.
+Using :ref:`Object.call_deferred() <class_Object_method_call_deferred>`,
+the second function will only run once all code from the current scene has
+completed. Thus, the current scene will not be removed while it is
+still being used (i.e. its code is still running).
 
 Finally, we need to fill the empty callback functions in the two scenes: