🆙 Memory usage fixes

This commit is contained in:
duckietm
2026-04-10 11:42:30 +02:00
parent 37f817a098
commit 399999f23d
6 changed files with 48 additions and 1 deletions
@@ -164,6 +164,18 @@ export class AvatarVisualization extends RoomObjectSpriteVisualization implement
if(this._avatarImage) this._avatarImage.dispose();
if(this._cachedAvatars)
{
for(const avatar of this._cachedAvatars.getValues()) avatar && avatar.dispose();
this._cachedAvatars.reset();
}
if(this._cachedAvatarEffects)
{
for(const avatar of this._cachedAvatarEffects.getValues()) avatar && avatar.dispose();
this._cachedAvatarEffects.reset();
}
if(this._reflectionOppositeTexture)
{
this._reflectionOppositeTexture.destroy(true);
@@ -27,6 +27,17 @@ export class IsometricImageFurniVisualization extends FurnitureAnimatedVisualiza
this._photoUrl = null;
}
public dispose(): void {
if (this._thumbnailTexture instanceof RenderTexture) {
this._thumbnailTexture.destroy(true);
}
this._thumbnailTexture = null;
this._thumbnailImageNormal = null;
super.dispose();
}
public get hasThumbnailImage(): boolean {
return !(this._thumbnailImageNormal == null);
}
@@ -158,6 +158,16 @@ export class RoomPlane implements IRoomPlane
this._animationLayers = [];
}
this._windowReflectionLastVisible.clear();
this._windowReflectionFadeOut.clear();
this._windowReflectionFirstSeenAt.clear();
if(this._maskFilter)
{
this._maskFilter.destroy();
this._maskFilter = null;
}
this._disposed = true;
}