mirror of
https://github.com/neovim/neovim
synced 2025-07-16 09:11:51 +00:00
fix(treesitter): uv_dlclose after uv_dlerror
This commit is contained in:
committed by
Lewis Russell
parent
0dfa4de993
commit
5a54681025
@ -128,9 +128,9 @@ static const TSLanguage *load_language_from_object(lua_State *L, const char *pat
|
|||||||
{
|
{
|
||||||
uv_lib_t lib;
|
uv_lib_t lib;
|
||||||
if (uv_dlopen(path, &lib)) {
|
if (uv_dlopen(path, &lib)) {
|
||||||
|
xstrlcpy(IObuff, uv_dlerror(&lib), sizeof(IObuff));
|
||||||
uv_dlclose(&lib);
|
uv_dlclose(&lib);
|
||||||
luaL_error(L, "Failed to load parser for language '%s': uv_dlopen: %s",
|
luaL_error(L, "Failed to load parser for language '%s': uv_dlopen: %s", lang_name, IObuff);
|
||||||
lang_name, uv_dlerror(&lib));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
char symbol_buf[128];
|
char symbol_buf[128];
|
||||||
@ -138,8 +138,9 @@ static const TSLanguage *load_language_from_object(lua_State *L, const char *pat
|
|||||||
|
|
||||||
TSLanguage *(*lang_parser)(void);
|
TSLanguage *(*lang_parser)(void);
|
||||||
if (uv_dlsym(&lib, symbol_buf, (void **)&lang_parser)) {
|
if (uv_dlsym(&lib, symbol_buf, (void **)&lang_parser)) {
|
||||||
|
xstrlcpy(IObuff, uv_dlerror(&lib), sizeof(IObuff));
|
||||||
uv_dlclose(&lib);
|
uv_dlclose(&lib);
|
||||||
luaL_error(L, "Failed to load parser: uv_dlsym: %s", uv_dlerror(&lib));
|
luaL_error(L, "Failed to load parser: uv_dlsym: %s", IObuff);
|
||||||
}
|
}
|
||||||
|
|
||||||
TSLanguage *lang = lang_parser();
|
TSLanguage *lang = lang_parser();
|
||||||
|
Reference in New Issue
Block a user