Closed hasnentai closed 11 months ago
Hi @hasnentai,
This happens if three3dRender.updateTexture(sourceTexture);
is ran after dispose.
Here is an example to prevent this from happening.
late FlutterGlPlugin three3dRender;
THREE.WebGLRenderer? renderer;
bool disposed = false;
@override
void dispose() {
disposed = true;
three3dRender.dispose();
super.dispose();
}
void animate() {
if (!mounted || disposed) {
return;
}
renderer!.render(scene, camera);
three3dRender.gl.flush();
if (!kIsWeb) {
three3dRender.updateTexture(sourceTexture);
}
Future.delayed(const Duration(milliseconds: 40), () {
animate();
});
}
Hope this helps.
Thank you this is working fine
Here is the Error I see in the log when I pop the page out and the app crashes.
Can you look into it @Knightro63 ?
Flutter Doctor