diff options
| author | t <t@tjp.lol> | 2026-07-03 13:01:25 -0600 |
|---|---|---|
| committer | t <t@tjp.lol> | 2026-07-03 13:24:31 -0600 |
| commit | 3ad5d90d0de2bfca6ef17b10202df070e660e3c3 (patch) | |
| tree | 37e6dd5c9b9b89255a4151b929694907f1b573cd /libpanto-lua | |
| parent | 51bbb62ce5d82c460c75adfc03813e84ce5183d3 (diff) | |
segfault fix
Diffstat (limited to 'libpanto-lua')
| -rw-r--r-- | libpanto-lua/src/module.zig | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/libpanto-lua/src/module.zig b/libpanto-lua/src/module.zig index 910334f..a707ecd 100644 --- a/libpanto-lua/src/module.zig +++ b/libpanto-lua/src/module.zig @@ -488,7 +488,8 @@ fn buildAgent(L: *c.lua_State, box: *AgentBox) ConfigError!void { ) catch return error.AgentInit; // Pin the store after Agent.init succeeds; the agent/session borrow it. - c.lua_pushvalue(L, -1); + // `luaL_ref` pops the store userdata, leaving the newly created Agent + // userdata on top for `agentNew` to return. box.store_ref = c.luaL_ref(L, LUA_REGISTRYINDEX); // Ownership of the inner conversation moved into the agent; neuter the |
