| 1151 | } |
| 1152 | |
| 1153 | void SpectrumWidget::prepareForTopLevelChange() |
| 1154 | { |
| 1155 | #ifdef AETHER_GPU_SPECTRUM |
| 1156 | // QRhiWidget registers a cleanup callback with the current top-level |
| 1157 | // backing-store QRhi. Direct splitter/floating-window reparenting can miss |
| 1158 | // Qt's internal notification, leaving the old QRhi with a stale callback; |
| 1159 | // when that QRhi is later torn down, runCleanup() fires against a stale |
| 1160 | // QRhiWidgetPrivate and crashes during deferred event delivery (#2495). |
| 1161 | // |
| 1162 | // QEvent::WindowAboutToChangeInternal is cross-platform Qt machinery — |
| 1163 | // QRhiWidgetPrivate deregisters the callback the same way on Metal, |
| 1164 | // D3D/Vulkan and OpenGL — so this must fire on every GPU platform, not |
| 1165 | // just macOS. It was originally gated to Q_OS_MAC because #2495 was first |
| 1166 | // reproduced there; leaving Windows ungated let the identical crash slip |
| 1167 | // through on connect-time multi-panadapter restore (#3714). The send must |
| 1168 | // happen exactly once, before the reparent (refreshAfterReparent must not |
| 1169 | // re-send it — see PanadapterStack.cpp). |
| 1170 | QEvent event(QEvent::WindowAboutToChangeInternal); |
| 1171 | QCoreApplication::sendEvent(this, &event); |
| 1172 | #endif |
| 1173 | } |
| 1174 | |
| 1175 | void SpectrumWidget::prepareForShutdown() |
| 1176 | { |
no outgoing calls
no test coverage detected