forked from KDAB/KDUtils
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Window: fix underlying platform not being destroyed
It appears at least with the XCB platform that in the case the Window is destroyed immediately before the GuiApplication gets destroyed we could end in a case where: - GuiApplication processes the events one last time before destruction - Trying to send event to now destroyed Window and PlatformWindow would crash This revealed a few issues (XCB platform): - LinuxXcbPlatformIntegration::window getter was expected to return null if passed an invalid key. Yet, it was using std::map::at which would throw if key out of range. - The Window when being destroyed would not destroy not unregister the platform window against LinuxXcbPlatformIntegration thus leaving a dangling pointer in the map of platformWindows. - The LinuxXcbPlatformEventLoop::processXcbEvents would not always check we still have a valid platformWindow when distributing events. A test was added to trigger such a case. Note that it would only trigger the issue randomly unless running with Valgrind where it gets triggered every time. In Win32PlatformWindow destroy() isn't called in the destructor anymore to make it in-line with other platforms. Otherwise, destroy() for win32 window would be called twice in ~Window(). Change-Id: I851c42c97a3c6f5e6c8bc4142bde7f9f1e61b48a Reviewed-on: https://codereview.kdab.com/c/kdab/kdutils/+/136870 Reviewed-by: Mike Krus <mike.krus@kdab.com> Tested-by: Continuous Integration <build@kdab.com> Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
- Loading branch information
Showing
6 changed files
with
44 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters