void heap_free(heap** H){ node* header = *H; node* first = header; if (header){ while(header != first){ node* next = header->right; node_kill(header); header = next; } } *H = NULL; }
static void worldsens_rx_disconnect(struct _worldsens_c_disconnect *pkt) { node_t *node = get_node_by_id(worldsens_get_wsnet_node_id(pkt->node_id)); if (node->worldsens != NODE_CONNECTED) { return; } node->worldsens = NODE_DISCONNECTED; node_kill(node->id); if (ws_connected == 0 && ws_count == get_node_count()) { end_simulation(); } }