Commit dcdc1a5
committed
fix(texture): guard render-thread teardown against engine shutdown
The render-thread teardown task posted by UnregisterTexture() captured a
raw engine pointer and only checked that the engine existed at post time.
If the engine shuts down before the task runs (PostRenderThreadTask then
runs it inline), calling gl_renderer->OnMakeCurrent() and
engine->UnregisterExternalTexture() touches an already-destroyed GL context
and a null engine handle.
Guard both calls with engine->IsRunning() inside the task; tex.reset() and
the completion callback still run unconditionally so the texture is released
and callers (e.g. webview_flutter_lwe) always get their 'safe to free'
signal.
Also reflow the FlutterDesktopTextureRegistrarUnregisterExternalTexture call
to satisfy clang-format.1 parent 4cd6db1 commit dcdc1a5
2 files changed
Lines changed: 13 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
330 | 330 | | |
331 | 331 | | |
332 | 332 | | |
333 | | - | |
334 | | - | |
| 333 | + | |
| 334 | + | |
335 | 335 | | |
336 | 336 | | |
337 | 337 | | |
| |||
Lines changed: 11 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
110 | 110 | | |
111 | 111 | | |
112 | 112 | | |
113 | | - | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
114 | 121 | | |
115 | 122 | | |
116 | 123 | | |
117 | | - | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
118 | 127 | | |
119 | 128 | | |
120 | 129 | | |
| |||
0 commit comments