Repository navigation
Commit e9894bf
committed
fix(core): also register global shutdown hook in PackageManager(Impl&) constructor
Manager::Manager() bypasses PackageManager() default constructor and
calls PackageManager(Impl&) directly. The default constructor registered
a global shutdown hook (setGlobalShutdownHook) to release ObjectPool
references before plugin DLLs are unloaded, but the Impl& constructor
path was missing this registration.
Without this hook, if the Runtime destruction callback (registered by
setupG2pOnnxDriver) does not fire (e.g. multiple Runtime instances,
Runtime not destroyed before static Manager destruction), the Manager
singleton's destructor at process exit triggers cleanup of Task objects
whose vtables reside in already-unloaded plugin DLLs, causing a
use-after-free crash in shared_ptr::_Decref.
This completes the fix chain:
- 3d1d66e (weak_ptr in factory)
- 5772823 (destruction callback)
- b4e2806 (global hook in default constructor)
- This commit (global hook in Impl& constructor)1 parent 674154f commit e9894bf
1 file changed
Lines changed: 22 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
617 | 617 | | |
618 | 618 | | |
619 | 619 | | |
| 620 | + | |
| 621 | + | |
| 622 | + | |
| 623 | + | |
| 624 | + | |
| 625 | + | |
| 626 | + | |
| 627 | + | |
| 628 | + | |
| 629 | + | |
| 630 | + | |
| 631 | + | |
| 632 | + | |
| 633 | + | |
| 634 | + | |
| 635 | + | |
| 636 | + | |
| 637 | + | |
| 638 | + | |
| 639 | + | |
| 640 | + | |
| 641 | + | |
620 | 642 | | |
621 | 643 | | |
622 | 644 | | |
| |||
0 commit comments