Commit af93ae0
authored
fix: use-after-free in Lua garbage collection of shared objects (#3553)
This fixes a critical use-after-free issue caused by the premature
destruction of SharedObject instances managed via std::shared_ptr during
Lua’s __gc finalization.
Previously, the luaGarbageCollection function called reset() directly on
the shared pointer, which could destroy the underlying object while it
was still in use by C++ code — potentially leading to heap corruption
and runtime crashes.1 parent cb905e5 commit af93ae0
1 file changed
+1
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
810 | 810 | | |
811 | 811 | | |
812 | 812 | | |
813 | | - | |
| 813 | + | |
814 | 814 | | |
815 | 815 | | |
816 | 816 | | |
| |||
0 commit comments