SimonDanisch / Bonito.jl

Serving JS to the browser
MIT License
204 stars 30 forks source link

Fix memory leak with DisplayHandler #186

Closed SimonDanisch closed 11 months ago

SimonDanisch commented 11 months ago

For long standing sessions as is the case with BrowserDisplay or in notebooks/vscode, deregister callbacks would accumulate unbounded, since they would be added to the root session, which will never be freed.

This little change adds them to the correct child session, so they get freed properly. This shouldn't concern the server use case, as a new root session is created for every request.

Also adds an error conversion, that I forgot to push, which improves error display in certain edge cases.