Skip to content

Commit 830129d

Browse files
committed
release memory
1 parent 5d69ba8 commit 830129d

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/cli/vm.c

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -286,10 +286,18 @@ static void initVM()
286286
uv_loop_init(loop);
287287
}
288288

289+
void on_uvClose(uv_handle_t* handle)
290+
{
291+
if (handle != NULL)
292+
{
293+
free(handle);
294+
}
295+
}
296+
289297
void on_uvWalkForShutdown(uv_handle_t* handle, void* arg)
290298
{
291299
if (!uv_is_closing(handle))
292-
uv_close(handle, NULL);
300+
uv_close(handle, on_uvClose);
293301
}
294302

295303
static void uvShutdown() {

0 commit comments

Comments
 (0)