koenkivits/nesnes

delete nesnes

Opened this issue · 2 comments

hi, is there a way to destroy nesnes machine?
For example if its open inside a lightbox and we close the instance it keeps running.

Stop is not an option because the lightbox gets generated dynamically and this means we need to reasign the canvas.

thx for help and cool project

Hi!

Thanks for filing an issue! Sorry for my late reply.
I'm not quite sure what you mean. Do you maybe have an online demo which shows the behavior you don't want? Thanks in advance!

No problem, no sorry no demo right now.... I try to explain it in detail.
I have a single page ember app where not page reoloads happen. When a user klicks a button a lightbox opens and the nesnes gets allocated. Now the user closes the lightbox. Nesnes still runs in background. Now the user reopens the lightbox and a new instance is created. Now i have 2 options (what i see for now)

  1. Ignore it and create a new instance every time.
  2. On lightbox close destroy canvas and set all nesnes properties (cpu etc) to null

Both doesnt feel realy good. It will be perfect if somesting like destroy nesnes instance will exist. Then i can use this method on lightbox close.

Thx for your support