Code

mpdclient: check source again after mpd_glib_leave()
[ncmpc.git] / src / plugin.c
index 05b83b70ff212d6ac94c59573fb4cc9fe41a57bb..f9049ecfa77458285c07da66f4946f542a1b4959 100644 (file)
@@ -216,7 +216,7 @@ plugin_fd_add(struct plugin_cycle *cycle, struct plugin_pipe *p, int fd)
        p->data = g_string_new(NULL);
        GIOChannel *channel = g_io_channel_unix_new(fd);
        p->event_id = g_io_add_watch(channel, G_IO_IN|G_IO_HUP,
-                                    plugin_data, cycle);
+                                    plugin_data, p);
        g_io_channel_unref(channel);
 }
 
@@ -294,7 +294,7 @@ next_plugin(struct plugin_cycle *cycle)
 
        if (cycle->next_plugin >= cycle->list->plugins->len) {
                /* no plugins left */
-               g_timeout_add(0, plugin_delayed_fail, cycle);
+               g_idle_add(plugin_delayed_fail, cycle);
                return;
        }
 
@@ -302,7 +302,7 @@ next_plugin(struct plugin_cycle *cycle)
                                                    cycle->next_plugin++);
        if (start_plugin(cycle, plugin_path) < 0) {
                /* system error */
-               g_timeout_add(0, plugin_delayed_fail, cycle);
+               g_idle_add(plugin_delayed_fail, cycle);
                return;
        }
 }