Skip to content
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

Infinite recursion edgecase #3

Open
DTV96Calibre opened this issue Jul 8, 2017 · 0 comments
Open

Infinite recursion edgecase #3

DTV96Calibre opened this issue Jul 8, 2017 · 0 comments

Comments

@DTV96Calibre
Copy link

If draw() or a function that calls draw() like windowResized() is called in the setup() function defined in a scene object, setupExecuted will not have yet been set to true and setup will again be called, resulting in runaway recursion. The workaround I'm using is to set setupExecuted to true before calling a function that calls draw(), as demonstrated here:

this.setup = function() {
     this.sceneManager.scene.setupExecuted = true;
     this.windowResized(); //NOTE: Requires setupExecuted override above to prevent infinite recursion
    }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant