Open TomKrauss opened 1 month ago
I've encountered the same issue. The windowManager.destroy()
method is taking several seconds to complete the shutdown process after upgrading to Flutter 3.24.0 on Windows. Previously, it worked smoothly and completed much faster.
Same issue! Any workaround or how you approach this guys @TomKrauss, @li9chuan?
Unfortunately no.
The Flutter version has been rolled back to 3.22.3, and window_manager has also been downgraded to 0.3.9 because of issue 483. @azlekov
Same issue! Any workaround or how you approach this guys @TomKrauss, @li9chuan?
@azlekov I encoutered the same problem. For the moment, I added exit(0);
after calling await windowManager.destroy();
So, like that the function onWindowClose()
is still called and completed, and with the exit(0);
, the app is instantly closed after. Maybe not the best solution, but I didn't encoure any problem at this time.
@override
void onWindowClose() async {
bool isPreventClose = await windowManager.isPreventClose();
if (isPreventClose) {
// ... disposing all my componenents, upgrade prefs, etc.
// Close app
await windowManager.destroy();
exit(0);
}
}
We use windowManager.destroy() in our application to shut down. This worked smoothly in the past and now with the upgrade to Flutter 3.24.0 it takes several seconds to complete and to finally shutdown the application.
Tested on Windows.