MCPcopy Create free account
hub / github.com/aethersdr/AetherSDR / prepareForTopLevelChange

Method prepareForTopLevelChange

src/gui/SpectrumWidget.cpp:1153–1173  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1151}
1152
1153void 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
1175void SpectrumWidget::prepareForShutdown()
1176{

Callers 3

rearrangeLayoutMethod · 0.80
floatPanadapterMethod · 0.80
dockPanadapterMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected