-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Move app destroy to frame end #3230
Conversation
This reverts commit d725667.
It seems like a valid request to be able to shut down the application from within the update, and so I think the solution is fine. |
src/framework/application.js
Outdated
@@ -408,6 +408,8 @@ class Application extends EventHandler { | |||
|
|||
app = this; | |||
|
|||
this._destroyThisFrame = false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would perhaps rename this to _destroyRequested
src/framework/application.js
Outdated
@@ -2162,6 +2170,7 @@ var makeTick = function (_app) { | |||
application._fillFrameStats(); | |||
// #endif | |||
|
|||
this._inFrameUpdate = true; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
have this variable in the constructor as well please, to not introduce variables to class during running.
Made changes from review and here's the test project: https://playcanvas.com/editor/scene/1067584 |
Fixes #3228
I'm really unsure about this as it is a kludge. I was thinking it might be better off as extra documentation for the function where app.destroy should not be called in an app.update.
I confirm I have read the contributing guidelines and signed the Contributor License Agreement.