(fix) assert WTrackTableView has a selectionModel() - #13620
Conversation
|
I don't yet understand why the box was modal before (not tested). The comment alone seems to be incomplete. A modal box disabled the main GUI. Why schoul that happen at all in case of a controller error? The user has no chance to perform the desired action with the GUI instead. I think there is an issue that the non modal boxes can be hidden behind the main window. Is that an issue here? |
|
At least ln case of crash the modal box disappears immediately. I can imagine that a box stays open when mixxx is closed normally by the error. Does it still happen? |
🤷
I presume this is supposed to cover the case where the mapping script's |
IIUC QMessageBox is always modal (stays on top). (even though it apparently doesn't have the flag (hint!) Fwiw in |
|
puuuh, sorry for the noise, it's entirely unrelated to the dialog and its modal flag. However, for some reason I can still reliably reproduce the crash related to
Will push soon.. |
5606b0f to
6e0463d
Compare
|
With the fix and some debug output I can see it's only the very first call of I'll take care of merging to 2.5 |
…tedRows(), early exit slotGuiTick50ms()
6e0463d to
1f438ca
Compare
daschuer
left a comment
There was a problem hiding this comment.
I have not a setup to confirm the fix but the code looks reasonable even without fixing an issue. Thnak you. LGTM
|
Yeah, I'm wondering why I didn't ever see such a crash and can reproduce it now each time. My env didn't change significantly, same Qt version, same Mixxx user data. Very weird.. |
|
Update This is the setup I can reliably reproduce it:
Running into assertions because of this is annyoning. I'll post a followup soon. ¹ this alone is weird, even considering the configured callbacks. |
|
IMO the controller mapping instantiation is already happening way too early. Lots of controller mappings already work around data races on startup by delaying their serato status sysex in the |
|
I agree (but I won't work on it) Followup is #13623 |
Issue:
Apparently it can happen that
WTrackTableView::slotGuiTick50msis called while may not yet have an item model, which in turn results in nonexistantselectionModel()Fix:
(actually only a workaround for the WTrackTableView with no model when GuiTick
[App], gui_tick_50ms_period_sis started)Assert we have a selection model, ie. cherry-pick and extend a6f1ba4
exit
WTrackTableView::slotGuiTick50msearly if WTrackTableView!isVisible()(I already did this locally and I didn' notice any regressions, but it'll cause quite some conflicts when merging 2.4 into 2.5/main)
Initially experienced this with main, but also happens with 2.4
old description, based on wrong assumption: Issue: Mapping error dialog can block loading the main GUI. If this happens sufficiently fast (eg. with MIDI Through in developer mode), WTrackTableView may not yet have an item model, which in turn results in nonexistant selectionModel() in WTrackTableView::slotGuiTick50ms. More precisely: ErrorDialogProperties show a modal dialog by default, which can block MixxxMainWindow::initialize() before it reaches loadConfiguredSkin(). This function emits skinLoaded --> SidebarModel::activateDefaultSelection() --> WTrackTableView loads LibraryTableModel. Ie. if this is blocked there is one WTrackTableView without a model, and thereby without a selectionModel(), which causes the crash. Quick fix: Make the mapping error dialogs non-modal. IIUC the purpose of modal dialogs is solely [Blocks so the user has a chance to read it before application exit](https://github.com/mixxxdj/mixxx/blob/d9704db8b9be57730d64594437a9a0b1fc754d56/src/errordialoghandler.cpp#L227) which (IIUC) is not required during startup. (if a mapping can crash Mixxx would this dialog be brought up in time?)