Unsubscribe removed Navara effects and models from warm view frames

This commit is contained in:
German Khokhlov committed 2026-11-03 05:16:20 +04:00
1 parent 14f7b32537
commit 05b646daa3
16 files changed
+90 -19

No files matched your search

+18
View File
@@ -0,0 +1,18 @@
// Navara auto-binds descriptor.update on creation but does not unregister
// that bound function when its handle is deleted. GEV's synchronous effects
// and meshes subscribe with their own callback so a parked view can be reused.
export function withFrameUpdates(Base) {
return class extends Base {
#frame = (time) => this.updateFrame(time);
onCreate() {
super.onCreate();
this.view.on('preRender', this.#frame);
}
onDestroy() {
this.view.off('preRender', this.#frame);
super.onDestroy();
}
};
}