Consider detaching game from DevToolsService when not needed

Abierto
#3,316 1 comentario 0 reacciones 1 asignado Ver en GitHub

Los mantenedores suelen responder en 1 día

@filiph ya está trabajando en esto.

Desde el 21/9/2024.

Evaluación

Este issue todavía no se ha evaluado.

Descripción

enhancement
What could be improved

Not a big deal, but currently, when running a game in debug mode, any FlameGame that is ever started will forever be retained in memory unless replaced with a different FlameGame.

From FlameGame's constructor:

    if (kDebugMode) {
      DevToolsService.initWithGame(this);
    }

There is no DevToolsService.detachGame() or anything similar.

Screenshot 2024-09-21 at 14 25 08

Why should this be improved

This can be confusing when one's looking at memory (albeit I agree that one should be normally doing that in profile mode) and sees a game that's supposed to be gone a long time ago, and won't go away even after manual GC.

This almost sent me on a wild goose chase for a giant game-sized memory leak.

Risks
  • Some people might want to inspect their game after it's been disposed?
  • Could introduce a DevTools connector bug where game's disposed too soon, for example.
More information

I'm not sure myself if this is something worth addressing. Just putting this here before I forget.

Other
  • Are you interested in working on a PR for this?
Lenguaje dominante
Dart
Estrellas
10.8k
Forks
1.1k
Merge medio
1 d 21 h
PR fusionados (30 d)
62

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de flame-engine/flame

Todos los issues de flame-engine/flame

Issues similares

Más issues de Dart

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.