diff options
Diffstat (limited to 'swaybar/tray/sni_watcher.c')
-rw-r--r-- | swaybar/tray/sni_watcher.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/swaybar/tray/sni_watcher.c b/swaybar/tray/sni_watcher.c index b89ac812..41a95c47 100644 --- a/swaybar/tray/sni_watcher.c +++ b/swaybar/tray/sni_watcher.c | |||
@@ -210,6 +210,7 @@ static void respond_to_introspect(DBusConnection *connection, DBusMessage *reque | |||
210 | 210 | ||
211 | static void register_item(DBusConnection *connection, DBusMessage *message) { | 211 | static void register_item(DBusConnection *connection, DBusMessage *message) { |
212 | DBusError error; | 212 | DBusError error; |
213 | DBusMessage *reply; | ||
213 | char *name; | 214 | char *name; |
214 | 215 | ||
215 | dbus_error_init(&error); | 216 | dbus_error_init(&error); |
@@ -235,7 +236,7 @@ static void register_item(DBusConnection *connection, DBusMessage *message) { | |||
235 | } | 236 | } |
236 | list_add(object_path_items, item); | 237 | list_add(object_path_items, item); |
237 | obj_path_item_registered_signal(connection, item); | 238 | obj_path_item_registered_signal(connection, item); |
238 | return; | 239 | goto send_reply; |
239 | } else { | 240 | } else { |
240 | sway_log(L_INFO, "This item is not valid, we cannot keep track of it."); | 241 | sway_log(L_INFO, "This item is not valid, we cannot keep track of it."); |
241 | return; | 242 | return; |
@@ -253,8 +254,9 @@ static void register_item(DBusConnection *connection, DBusMessage *message) { | |||
253 | item_registered_signal(connection, name); | 254 | item_registered_signal(connection, name); |
254 | } | 255 | } |
255 | 256 | ||
257 | send_reply: | ||
256 | // It's silly, but clients want a reply for this function | 258 | // It's silly, but clients want a reply for this function |
257 | DBusMessage *reply = dbus_message_new_method_return(message); | 259 | reply = dbus_message_new_method_return(message); |
258 | dbus_connection_send(connection, reply, NULL); | 260 | dbus_connection_send(connection, reply, NULL); |
259 | dbus_message_unref(reply); | 261 | dbus_message_unref(reply); |
260 | } | 262 | } |