kmamal / node-sdl

🎮 SDL bindings for Node.js
https://www.npmjs.com/package/@kmamal/sdl
MIT License
121 stars 11 forks source link

Destroy window will exit the process? #25

Closed LmanTW closed 1 year ago

LmanTW commented 1 year ago

I found that destroying the window seems to make the process exit. Is there a way to prevent it from exiting?

kmamal commented 1 year ago

Yes, you can call

sdl.on('beforeQuit', (event) => { event.prevent() })

https://github.com/kmamal/node-sdl#event-beforequit

kmamal commented 1 year ago

Closing this as solved, let me know if you have problems and I'll reopen it.

kmamal commented 1 year ago

@LmanTW I have found a better way to handle the process lifetime so now after v0.7.0 destroying a window won't cause the process to exit if you have other stuff going on.