static void close_cb(uv_handle_t *handle) { free(handle); }
+static void async_free_cb(uv_handle_t *handle) {
+ free((uv_async_t *) handle -> data);
+}
+
pty_buf_t *pty_buf_init(char *base, size_t len) {
pty_buf_t *buf = xmalloc(sizeof(pty_buf_t));
buf->base = xmalloc(len);
char **p = process->envp;
for (; *p; p++) free(*p);
free(process->envp);
- free(process);
}
void pty_pause(pty_process *process) {
process->exit_signal = 1;
process->exit_cb(process);
- uv_close((uv_handle_t *) async, NULL);
+ uv_close((uv_handle_t *) async, async_free_cb);
process_free(process);
}
pty_process *process = (pty_process *) async->data;
process->exit_cb(process);
- uv_close((uv_handle_t *) async, NULL);
+ uv_close((uv_handle_t *) async, async_free_cb);
process_free(process);
}