Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Windows GUI crash on close #3910

Merged
merged 1 commit into from
Jan 31, 2025
Merged

Conversation

Sploder12
Copy link
Contributor

Previously the GUI would always crash when the GUI is closed. This PR makes it so the GUI does not crash when it is closed. The issue was due to destructor call ordering for the GUI Window. FlutterWindow (subclass of Win32Window) would begin destruction which destructs the FlutterViewController and then the Win32Window base class. The FlutterViewController is registered to a Windows callback that is removed when Win32Window is destructed, but since the FlutterViewController gets destructed before the Win32Window there is some time where the callback is still active but the FlutterViewController is in an invalid state.

MULTI-1711

Copy link

codecov bot commented Jan 30, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 89.10%. Comparing base (724933c) to head (93d289f).
Report is 5 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3910   +/-   ##
=======================================
  Coverage   89.10%   89.10%           
=======================================
  Files         255      255           
  Lines       14600    14600           
=======================================
  Hits        13010    13010           
  Misses       1590     1590           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@andrei-toterman andrei-toterman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yup, no more crashes. Thanks, @Sploder12!
But then is this a bug in Flutter itself? This code was generated by them, not written by us 🤔

@andrei-toterman andrei-toterman added this pull request to the merge queue Jan 31, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to no response for status checks Jan 31, 2025
@andrei-toterman andrei-toterman added this pull request to the merge queue Jan 31, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Jan 31, 2025
@andrei-toterman andrei-toterman added this pull request to the merge queue Jan 31, 2025
Merged via the queue into main with commit d6855b5 Jan 31, 2025
14 checks passed
@andrei-toterman andrei-toterman deleted the fix-windows-gui-close-crash branch January 31, 2025 15:47
@Sploder12
Copy link
Contributor Author

But then is this a bug in Flutter itself? This code was generated by them, not written by us 🤔

Interesting... it could be

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants