Skip to content

Infinite recursion edgecase #3

@DTV96Calibre

Description

@DTV96Calibre

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
    }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions