Skip to content

Commit

Permalink
[libprofile] Skip match removal if D-Bus connection is closed. Fixes …
Browse files Browse the repository at this point in the history
…JB#24365

Attempting to remove signal matches on exit that happens after D-Bus
connection is closed leads into useless warnings about closed connection.

Do match removal only if the connection is still alive.
  • Loading branch information
spiiroin committed Mar 14, 2015
1 parent 9795388 commit 407719c
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions tracker.c
Expand Up @@ -386,13 +386,16 @@ profile_tracker_disconnect(void)
{
ENTER
/* stop listening to profiled signals */
dbus_bus_remove_match(profile_tracker_con, PROFILED_MATCH, &err);

if( dbus_error_is_set(&err) )
if( dbus_connection_get_is_connected(profile_tracker_con) )
{
log_err("%s: %s: %s\n", "dbus_bus_remove_match",
err.name, err.message);
dbus_error_free(&err);
dbus_bus_remove_match(profile_tracker_con, PROFILED_MATCH, &err);

if( dbus_error_is_set(&err) )
{
log_err("%s: %s: %s\n", "dbus_bus_remove_match",
err.name, err.message);
dbus_error_free(&err);
}
}

/* remove message filter function */
Expand Down

0 comments on commit 407719c

Please sign in to comment.