Closing libUV Handles Correctly
问题 I'm trying to find out how to fix these memory leaks I'm getting while running this program with Valgrind. The leaks occur with the two allocations in nShell_client_main . But I'm not sure how to properly free them. I've tried freeing them at nShell_Connect, but it's causing libUV to abort the program. I've tried freeing them at the end of nShell_client_main , but then I get read/write errors when closing the loop. Does anyone know how I'm supposed to close these handles? I've read this,