Commit 45f0530
committed
gui: guard Gui API against null main_window in headless/web mode
In -web/headless mode the static main_window is null while Gui::enabled()
is true (the web HeadlessViewer is installed). Public Gui methods
dereferenced main_window unconditionally, so any call reaching them from
the web render thread or from a module's debug-graphics renderer crashed
(issue #10576, e.g. HeatMapRenderer::drawObjects ->
Renderer::checkDisplayControl -> Gui::checkDisplayControlsVisible).
- Add an early `if (!hasUI())` guard to the affected Gui methods: no-op
for void methods, safe default (0/""/false/empty static) otherwise.
- Route the display-control accessors to the HeadlessViewer when the Qt
widget is absent; extend HeadlessViewer with default-safe virtuals.
- Replace the false-positive `enabled()` guards (true in web) with
`hasUI()` in saveImage/saveClockTreeImage/saveHistogramImage/
showWorstTimingPath/clearTimingPath/selectClockviewerClock/selectHelp/
selectChart/gifStart/setLogger.
- Guard the static findWidget() helper at its root.
The guards only fire when main_window is null, so interactive -gui
behavior is unchanged.
Signed-off-by: Jorge Ferreira <jorge.ferreira@precisioninno.com>1 parent 4c26918 commit 45f0530
2 files changed
Lines changed: 239 additions & 14 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
741 | 741 | | |
742 | 742 | | |
743 | 743 | | |
| 744 | + | |
| 745 | + | |
| 746 | + | |
| 747 | + | |
| 748 | + | |
| 749 | + | |
| 750 | + | |
| 751 | + | |
| 752 | + | |
| 753 | + | |
| 754 | + | |
| 755 | + | |
| 756 | + | |
| 757 | + | |
| 758 | + | |
| 759 | + | |
| 760 | + | |
| 761 | + | |
744 | 762 | | |
745 | 763 | | |
746 | 764 | | |
| |||
0 commit comments