void kqueue_root_dtor(w_root_t *root) { struct kqueue_root_state *state = root->watch; if (!state) { return; } pthread_mutex_destroy(&state->lock); close(state->kq_fd); state->kq_fd = -1; w_ht_free(state->name_to_fd); w_ht_free(state->fd_to_name); free(state); root->watch = NULL; }
void kqueue_root_dtor(watchman_global_watcher_t watcher, w_root_t *root) { struct kqueue_root_state *state = root->watch; unused_parameter(watcher); if (!state) { return; } pthread_mutex_destroy(&state->lock); close(state->kq_fd); state->kq_fd = -1; w_ht_free(state->name_to_fd); w_ht_free(state->fd_to_name); free(state); root->watch = NULL; }
void derived_client_dtor(struct watchman_client *ptr) { struct watchman_user_client *client = (struct watchman_user_client *)ptr; /* cancel subscriptions */ w_ht_free(client->subscriptions); client->subscriptions = NULL; w_client_vacate_states(client); }
static void delete_subscription(w_ht_val_t val) { struct watchman_client_subscription *sub = w_ht_val_ptr(val); w_string_delref(sub->name); w_query_delref(sub->query); if (sub->drop_or_defer) { w_ht_free(sub->drop_or_defer); } free(sub); }
static void dispose_name(void *data) { struct name_data *name = data; if (name->map) { w_ht_free(name->map); } if (name->name) { w_string_delref(name->name); } free(name); }
static void client_delete(w_ht_val_t val) { struct watchman_client *client = (struct watchman_client*)val; /* cancel subscriptions */ w_ht_free(client->subscriptions); w_json_buffer_free(&client->reader); w_json_buffer_free(&client->writer); close(client->ping[0]); close(client->ping[1]); close(client->fd); free(client); }
void inot_root_dtor(watchman_global_watcher_t watcher, w_root_t *root) { struct inot_root_state *state = root->watch; unused_parameter(watcher); if (!state) { return; } pthread_mutex_destroy(&state->lock); close(state->infd); state->infd = -1; if (state->wd_to_name) { w_ht_free(state->wd_to_name); state->wd_to_name = NULL; } if (state->move_map) { w_ht_free(state->move_map); state->move_map = NULL; } free(state); root->watch = NULL; }
void inot_root_dtor(w_root_t *root) { struct inot_root_state *state = root->watch; if (!state) { return; } pthread_mutex_destroy(&state->lock); close(state->infd); state->infd = -1; if (state->wd_to_name) { w_ht_free(state->wd_to_name); state->wd_to_name = NULL; } if (state->move_map) { w_ht_free(state->move_map); state->move_map = NULL; } free(state); root->watch = NULL; }
static void client_delete(w_ht_val_t val) { struct watchman_client *client = w_ht_val_ptr(val); struct watchman_client_response *resp; /* cancel subscriptions */ w_ht_free(client->subscriptions); while (client->head) { resp = client->head; client->head = resp->next; json_decref(resp->json); free(resp); } w_json_buffer_free(&client->reader); w_json_buffer_free(&client->writer); close(client->ping[0]); close(client->ping[1]); close(client->fd); free(client); }
static void client_delete(w_ht_val_t val) { struct watchman_client *client = w_ht_val_ptr(val); struct watchman_client_response *resp; w_log(W_LOG_DBG, "client_delete %p\n", client); /* cancel subscriptions */ w_ht_free(client->subscriptions); while (client->head) { resp = client->head; client->head = resp->next; json_decref(resp->json); free(resp); } w_json_buffer_free(&client->reader); w_json_buffer_free(&client->writer); w_event_destroy(client->ping); w_stm_close(client->stm); free(client); }
void w_trigger_command_free(struct watchman_trigger_command *cmd) { if (cmd->triggername) { w_string_delref(cmd->triggername); } if (cmd->command) { json_decref(cmd->command); } if (cmd->definition) { json_decref(cmd->definition); } if (cmd->query) { w_query_delref(cmd->query); } if (cmd->envht) { w_ht_free(cmd->envht); } free(cmd); }