Skip to content

Window garbage collected too "early" #1

@Freezerburn

Description

@Freezerburn

In a simple test game I'm writing, I used setTimeout to get an infinite loop going with a "ticker" function that would run 60 times per second. However, due to the fact that I did not have any references to the window inside of the function that was constantly being run, node decided that the "var window = ..." bit I had farther up in the code was no longer valid and would soon garbage collect it, causing the window to be destroyed.

While this is technically not a bug, a workaround to this is desirable, so that everybody who decides to write code using setTimeout (or whatever gets provided in the SDL wrapper) does not have to have some hacky fix such as "var mywindow = window" inside of their ticker function.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions