diff options
| author | zeertzjq <zeertzjq@outlook.com> | 2024-04-17 05:44:06 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-04-17 05:44:06 +0800 |
| commit | f150b62423d57b6f9fbe57330589937dfbb34f4a (patch) | |
| tree | c6d137ab0d2164e97adce7f3ddce689bc97b0a86 /src/nvim/generators | |
| parent | 8e5c48b08dad54706500e353c58ffb91f2684dd3 (diff) | |
| download | rneovim-f150b62423d57b6f9fbe57330589937dfbb34f4a.tar.gz rneovim-f150b62423d57b6f9fbe57330589937dfbb34f4a.tar.bz2 rneovim-f150b62423d57b6f9fbe57330589937dfbb34f4a.zip | |
fix(lua): only free luarefs when returning from API (#28373)
Diffstat (limited to 'src/nvim/generators')
| -rw-r--r-- | src/nvim/generators/gen_api_dispatch.lua | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/nvim/generators/gen_api_dispatch.lua b/src/nvim/generators/gen_api_dispatch.lua index e9bc5e5fe3..b0f169ea6f 100644 --- a/src/nvim/generators/gen_api_dispatch.lua +++ b/src/nvim/generators/gen_api_dispatch.lua @@ -913,7 +913,7 @@ exit_0: write_shifted_output(string.format( [[ if (lua_gettop(lstate) == 0) { - nlua_push_%s(lstate, %sret, true); + nlua_push_%s(lstate, %sret, kNluaPushSpecial | kNluaPushFreeRefs); } ]], return_type, @@ -927,10 +927,10 @@ exit_0: else local special = (fn.since ~= nil and fn.since < 11) write_shifted_output( - ' nlua_push_%s(lstate, %sret, %s);\n', + ' nlua_push_%s(lstate, %sret, %s | kNluaPushFreeRefs);\n', return_type, ret_mode, - tostring(special) + special and 'kNluaPushSpecial' or '0' ) end |