This repository was archived by the owner on Sep 8, 2025. It is now read-only.
Commit 1ed8892
committed
fix memory leak when panicking with detached
In `ComponentInstance::from_vmctx` and
`StoreContextMut::with_detached_instance[_async]` we were leaking memory due to
having taken `InstanceData` out of the `Store` and making it unreachable except
via a raw pointer, meaning there was nothing responsible for dropping it on
panic. This commit adds an RAII wrapper to take care of that.
Signed-off-by: Joel Dice <joel.dice@fermyon.com>ComponentInstance
1 parent 90e7e16 commit 1ed8892
1 file changed
Lines changed: 19 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
685 | 685 | | |
686 | 686 | | |
687 | 687 | | |
| 688 | + | |
| 689 | + | |
| 690 | + | |
| 691 | + | |
| 692 | + | |
| 693 | + | |
| 694 | + | |
| 695 | + | |
688 | 696 | | |
689 | 697 | | |
690 | 698 | | |
| |||
721 | 729 | | |
722 | 730 | | |
723 | 731 | | |
724 | | - | |
725 | | - | |
726 | | - | |
727 | | - | |
728 | | - | |
| 732 | + | |
| 733 | + | |
| 734 | + | |
| 735 | + | |
| 736 | + | |
| 737 | + | |
729 | 738 | | |
730 | 739 | | |
731 | 740 | | |
| |||
753 | 762 | | |
754 | 763 | | |
755 | 764 | | |
756 | | - | |
757 | | - | |
758 | | - | |
759 | | - | |
| 765 | + | |
| 766 | + | |
| 767 | + | |
| 768 | + | |
| 769 | + | |
760 | 770 | | |
761 | 771 | | |
762 | 772 | | |
| |||
0 commit comments