Closing stream

This commit is contained in:
Erick Zanardo
2020-01-26 13:46:22 -03:00
parent c506dd0553
commit c615d3effe

View File

@@ -61,7 +61,15 @@ abstract class Game {
void onAttach() {}
// 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 {