Browse Source

【重要问题】解决使用end进入多行模式后再使用exit退出多行导致的重复释放错误

master
Lizongdi 1 week ago
parent
commit
07bf576920
  1. 2
      lua/lua.c

2
lua/lua.c

@ -466,6 +466,7 @@ int lua_repl(char *_pcBuffer, int _iSize, int _iEcho)
if (strcmp(line, "exit") == 0) if (strcmp(line, "exit") == 0)
{ {
RD_FREE(line); RD_FREE(line);
line = NULL;
iRet = RD_SUCCESS; iRet = RD_SUCCESS;
goto cleanup; goto cleanup;
} }
@ -626,6 +627,7 @@ cleanup:
wrapped_code = NULL; wrapped_code = NULL;
} }
RD_FREE(buffer); RD_FREE(buffer);
buffer = NULL;
lua_close(L); lua_close(L);
L = NULL; L = NULL;
lua_init(lua_print); lua_init(lua_print);

Loading…
Cancel
Save