-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Closed
Closed
Copy link
Labels
a: desktopRunning on desktopRunning on desktopa: multi windowIssues related to multi window supportIssues related to multi window supportc: crashStack traces logged to the consoleStack traces logged to the consoleengineflutter/engine related. See also e: labels.flutter/engine related. See also e: labels.platform-windowsBuilding on or for Windows specificallyBuilding on or for Windows specificallyr: fixedIssue is closed as already fixed in a newer versionIssue is closed as already fixed in a newer versionteam-windowsOwned by the Windows platform teamOwned by the Windows platform team
Description
Steps to reproduce:
- Launch a Flutter multi-window app on Windows (e.g., a sample from the "MVP - The Multi View Playground", or the reference app from [windows] implement regular windows and supporting method channels #157515).
- Open a new window.
- Press
Alt+F4to close it. - The engine may crash.
Possible cause:
When a key is pressed, FlutterWindowsView::SendKey sends the raw keyboard event to the engine along with a lambda expression as a KeyEventCallback for processing the queued events. Because Alt+F4 immediately closes the window, the view may be destroyed before the callback is invoked. The engine crashes when the callback tries to access already-destroyed objects, such as the FlutterWindowsView itself (its this pointer is captured by the lambda to access FlutterWindowsView::engine_) and the KeyboardManager object, which is owned by the FlutterWindow destroyed with the view.
Metadata
Metadata
Assignees
Labels
a: desktopRunning on desktopRunning on desktopa: multi windowIssues related to multi window supportIssues related to multi window supportc: crashStack traces logged to the consoleStack traces logged to the consoleengineflutter/engine related. See also e: labels.flutter/engine related. See also e: labels.platform-windowsBuilding on or for Windows specificallyBuilding on or for Windows specificallyr: fixedIssue is closed as already fixed in a newer versionIssue is closed as already fixed in a newer versionteam-windowsOwned by the Windows platform teamOwned by the Windows platform team
Type
Projects
Status
Done