properly free cmd_queue, should partially fix #165 from what i tell from its log.

This commit is contained in:
taiyu 2015-09-02 08:51:26 -07:00
parent 1756a4f2da
commit 782729be13

View file

@ -485,12 +485,12 @@ static bool handle_pointer_button(wlc_handle view, uint32_t time, const struct w
static void handle_wlc_ready(void) { static void handle_wlc_ready(void) {
sway_log(L_DEBUG, "Compositor is ready, executing cmds in queue"); sway_log(L_DEBUG, "Compositor is ready, executing cmds in queue");
// Execute commands until there are none left
int i; while (config->cmd_queue->length) {
for (i = 0; i < config->cmd_queue->length; ++i) { handle_command(config, config->cmd_queue->items[0]);
handle_command(config, config->cmd_queue->items[i]); free(config->cmd_queue->items[0]);
list_del(config->cmd_queue, 0);
} }
free_flat_list(config->cmd_queue);
config->active = true; config->active = true;
} }