-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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 CoreServices shutdown responsibility and fix lp1912129 #4213
Conversation
78b0f41
to
e1df6f3
Compare
Pull Request Test Coverage Report for Build 1139452486
💛 - Coveralls |
src/coreservices.cpp
Outdated
return; | ||
} | ||
|
||
shutdown(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about removing the shutdown function and moving its implementation to the destructor?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, maybe we could keep both methods separate, because the belong to each other. One does the set up and its sibling the tear down. How about renaming them to initialize()
and finalize()
to emphasize this relationship?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I removed the method. Originally I wanted to keep it to keep the line count small.
This leaves less room for wrong usage (like calling `shutdown()` when it was never initialized or forgetting to call `shutdown()` at all). Also, `MixxxMainWindow` should not be responsible for shutting down `CoreServices`, which is also solved here.
Fixes [lp1912129]. This gets rid of an issue where Mixxx failed with an assertion during shutdown that complained about leaked controls (that are owned by the menu bar): warning [Main] The following 6 controls were leaked: warning [Main] "[VinylControl]" "show_vinylcontrol" QObject(0x0) warning [Main] "[Master]" "skin_settings" QObject(0x0) warning [Main] "[PreviewDeck]" "show_previewdeck" QObject(0x0) warning [Main] "[Master]" "maximize_library" QObject(0x0) warning [Main] "[Library]" "show_coverart" QObject(0x0) warning [Main] "[Microphone]" "show_microphone" QObject(0x0) DEBUG ASSERT: "!"Controls were leaked!"" in function void mixxx::CoreServices::shutdown() at /home/jan/Projects/mixxx/src/coreservices.cpp:582 Aborted (core dumped) The issue occurs when shutting down Mixxx by pressing <Super>+q in Pop! Shell which closes the window immediately. Apparently this is incomaptible with our `sendPostedEvents()` trick to destroy the menubar and leads to `CoreServices` being shut down before the Menubar is actually destroyed, leaving some COs intact and triggering the assertion. This fixes the issue by ensuring that `MixxxMainWindow` is always completely destroyed before `CoreServices::shutdown()` is called. [lp1912129]: https://bugs.launchpad.net/mixxx/+bug/1912129
e1df6f3
to
b1cf8bc
Compare
src/coreservices.cpp
Outdated
qDebug() << t.elapsed(false).debugMillisWithUnit() << "deleting SettingsManager"; | ||
m_pSettingsManager.reset(); | ||
|
||
CLEAR_AND_CHECK_DELETED(m_pKeyboardEventFilter); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This and below is initialized in the C-Tor and skipped if initialize() has not been called.
Maybe it was a good idea to implement a counter part to initialize() to make this obvious.
f83f43e
to
54bd6f5
Compare
Please see the commit messages for details.
Fixes https://bugs.launchpad.net/mixxx/+bug/1912129.