Commit d156d3a
Use atexit instead of DLL destructor for cleanup
DLL destructors (__attribute__((destructor))) run during DLL_PROCESS_DETACH
when other DLLs may already be unloaded. Calling g_object_unref at that
point crashes because GLib's vtable is gone.
Switch to atexit() which runs before DLL unloading. Since we register
after gsf_init() (which registers GLib's own atexit handlers), LIFO
ordering ensures our cleanup runs first.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>1 parent 6a3b102 commit d156d3a
1 file changed
Lines changed: 9 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
4 | 5 | | |
5 | 6 | | |
6 | 7 | | |
| |||
273 | 274 | | |
274 | 275 | | |
275 | 276 | | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
276 | 284 | | |
277 | 285 | | |
278 | 286 | | |
| |||
283 | 291 | | |
284 | 292 | | |
285 | 293 | | |
286 | | - | |
287 | | - | |
288 | | - | |
289 | | - | |
290 | | - | |
291 | | - | |
292 | | - | |
293 | | - | |
| 294 | + | |
294 | 295 | | |
0 commit comments