Skip to content

Commit

Permalink
Update & publish new doc versions
Browse files Browse the repository at this point in the history
  • Loading branch information
Blue Fire committed Jul 29, 2023
1 parent b89e12d commit bb89d76
Show file tree
Hide file tree
Showing 8 changed files with 18,332 additions and 18,296 deletions.
15 changes: 15 additions & 0 deletions docs/main/_sources/flame/game.md.txt
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,21 @@ in order: `onLoad`, `onGameResize` and `onMount`. After that, it goes on to call
Once the `GameWidget` is removed from the tree, `onRemove` is called, just like when a normal
component is removed from the component tree.

```{note}
The `onRemove` can be used to clean up potential memory leaks by doing the following:
```

```dart
@override
void onRemove() {
removeAll(children);
processLifecycleEvents();
Flame.images.clearCache();
Flame.assets.clearCache();
// Any other code that you want to run when the game is removed.
}
```


## Debug mode

Expand Down
Loading

0 comments on commit bb89d76

Please sign in to comment.