Skip to content

Commit

Permalink
replace uv_default_loop with luv_loop
Browse files Browse the repository at this point in the history
* uv_default_loop it not thread safe
  • Loading branch information
zhaozg committed Dec 27, 2021
1 parent 2335e28 commit f70dd85
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/lminiz.c
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ static int lmz_reader_init(lua_State* L) {
luaL_getmetatable(L, "miniz_reader");
lua_setmetatable(L, -2);
memset(archive, 0, sizeof(*archive));
zip->loop = uv_default_loop();
zip->loop = luv_loop(L);
zip->fd = uv_fs_open(zip->loop, &(zip->req), path, O_RDONLY, 0644, NULL);
uv_fs_fstat(zip->loop, &(zip->req), zip->fd, NULL);
size = zip->req.statbuf.st_size;
Expand Down Expand Up @@ -191,7 +191,7 @@ static int lmz_writer_init(lua_State *L) {
luaL_getmetatable(L, "miniz_writer");
lua_setmetatable(L, -2);
memset(archive, 0, sizeof(*archive));
zip->loop = uv_default_loop();
zip->loop = luv_loop(L);
if (!mz_zip_writer_init_heap(archive, size_to_reserve_at_beginning, initial_allocation_size)) {
return luaL_error(L, "Problem initializing heap writer");
}
Expand Down

0 comments on commit f70dd85

Please sign in to comment.