mirror of
https://github.com/flame-engine/flame.git
synced 2025-11-17 21:29:38 +08:00
Closing stream
This commit is contained in:
@@ -61,7 +61,15 @@ abstract class Game {
|
|||||||
void onAttach() {}
|
void onAttach() {}
|
||||||
|
|
||||||
// Called when the Game widget is detached
|
// Called when the Game widget is detached
|
||||||
void onDetach() {}
|
@mustCallSuper
|
||||||
|
void onDetach() {
|
||||||
|
// Keeping this here, because if we leave this on HasWidgetsOverlay
|
||||||
|
// and somebody overrides this and forgets to call the stream close
|
||||||
|
// we can face some leaks.
|
||||||
|
if (this is HasWidgetsOverlay) {
|
||||||
|
(this as HasWidgetsOverlay).widgetOverlayController.close();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class OverlayWidget {
|
class OverlayWidget {
|
||||||
|
|||||||
Reference in New Issue
Block a user