Commit afda9cb
committed
Fix: ManualRender RunnerParams lifetime management
Fixes segfault when using ManualRender with SetupFromSimpleRunnerParams()
or SetupFromGuiFunction(). After changing SetupFromRunnerParams() to keep
a reference instead of a copy, the temporary RunnerParams created in these
functions would go out of scope, leaving a dangling pointer.
Changes:
- Add gStoredRunnerParams to store RunnerParams when created internally
- Store RunnerParams in SetupFromSimpleRunnerParams() before passing reference
- Store RunnerParams in SetupFromGuiFunction() before passing reference
- Clear stored params in Priv_TearDown() for proper cleanup
- Remove obsolete gLastRunnerParamsOpt (no longer needed after #417 fix)
This mirrors the pattern used in ImmApp and ensures RunnerParams lifetime
is managed correctly for both user-provided and internally-created params.
Fixes segfault in hello_imgui.nb.start() on desktop platforms.
Related: #4171 parent 8f4d797 commit afda9cb
1 file changed
Lines changed: 11 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
55 | 55 | | |
56 | 56 | | |
57 | 57 | | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
58 | 62 | | |
59 | 63 | | |
60 | 64 | | |
| |||
127 | 131 | | |
128 | 132 | | |
129 | 133 | | |
| 134 | + | |
130 | 135 | | |
131 | 136 | | |
132 | 137 | | |
| |||
171 | 176 | | |
172 | 177 | | |
173 | 178 | | |
174 | | - | |
175 | | - | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
176 | 182 | | |
177 | 183 | | |
178 | 184 | | |
| |||
195 | 201 | | |
196 | 202 | | |
197 | 203 | | |
198 | | - | |
199 | | - | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
200 | 207 | | |
201 | 208 | | |
202 | 209 | | |
| |||
0 commit comments