Commit 16a93c9
authored
Fix LoadedPlugins::remove crash during static destruction (#12854)
When a PluginFactory is destroyed during static destruction (after main
exits), the EThreads are already gone. LoadedPlugins::remove() was
crashing because it tried to acquire a mutex lock using this_ethread(),
which returns nullptr during static destruction.
Now check if this_ethread() returns nullptr and handle cleanup directly
in that case, since we're exiting anyway and don't need the mutex
protection or scheduled deletion.
This issue was discovered while testing the header_rewrite run-plugin
feature, which creates a PluginFactory that persists as a static object
and is destroyed during static destruction.1 parent 9b7734e commit 16a93c9
1 file changed
Lines changed: 10 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
329 | 329 | | |
330 | 330 | | |
331 | 331 | | |
332 | | - | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
333 | 341 | | |
334 | 342 | | |
335 | | - | |
| 343 | + | |
336 | 344 | | |
337 | 345 | | |
338 | 346 | | |
| |||
0 commit comments