-
Notifications
You must be signed in to change notification settings - Fork 35
Open
Description
hello,
context: I start and dispose threeJs each time I call an animation:
stateInitializeStarted = true;
isReinitializing = true;
disposeThreeJs();
threeJs = null;
three.loading.clear();
isSetup = false;
hasRenderedOnce = false;
var completer = Completer<void>();
threeJs = three.ThreeJS(
size: renderWidth != null && renderHeight != null ? Size(renderWidth!.toDouble(), renderHeight!.toDouble()) : null,
onSetupComplete: () {
if (!completer.isCompleted) {
completer.complete();
}
setStateSafe(() { isSetup = true; });
},
setup: setup,
settings: three.Settings(
alpha: true,
clearAlpha: 0.0,
clearColor: 0x000000,
animate: false,
)
);And when finishing:
isRollSfxCancelled = true;
await _fadeController.reverse();
_stopAnimateTicker();
Dice3DView._cleanupCompleter?.complete();
Dice3DView._cleanupCompleter = null;
Dice3DView.cleanupFuture = null;
Dice3DLoader.stopAllSfx();
resultText = null;
clearDice();
_stopFixedUpdateTimer();
_disposeThreeJsAfterRoll();where
void _disposeThreeJsAfterRoll() {
disposeThreeJs(); threeJs = null;
world = null;
isSetup = false;
hasRenderedOnce = false;
stateInitializeStarted = false;
isReinitializing = false;
setStateSafe(() {});
}each time I roll dice in my app, with version 0.2.0, memory increases really badly:
The same happens in iOS
Does not seem to happen on Windows at all, staying stable over there. Always rolling the same 2d8 dice models:

Metadata
Metadata
Assignees
Labels
No labels