add some logs, fix frontend memory leak with users not deallocating their haku

closes #28
This commit is contained in:
りき萌 2024-08-22 20:49:24 +02:00
parent 6c88a041ea
commit 4ebd150e59
3 changed files with 28 additions and 5 deletions

View file

@ -130,6 +130,11 @@ export class Haku {
w.haku_limits_destroy(pLimits);
}
destroy() {
w.haku_brush_destroy(this.#pBrush);
w.haku_instance_destroy(this.#pInstance);
}
setBrush(code) {
w.haku_reset(this.#pInstance);
// NOTE: Brush is invalid at this point, because we reset removes all defs and registered chunks.