diff options
author | Johan Hedberg <johan.hedberg@nokia.com> | 2007-07-19 11:22:06 +0000 |
---|---|---|
committer | Johan Hedberg <johan.hedberg@nokia.com> | 2007-07-19 11:22:06 +0000 |
commit | fb2c49cfc95ee82f77df6b8242199599f5e9f9ee (patch) | |
tree | 50b7ed79f50ff964bb820529472818d87f71c276 /common | |
parent | 7c386bc929463c6aad12677bfe0de8238ce26220 (diff) |
Invalidate parent data before unregistering the child path since the unregister function might free the child path string (if it is part of the object path data)
Diffstat (limited to 'common')
-rw-r--r-- | common/dbus-helper.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/common/dbus-helper.c b/common/dbus-helper.c index 488b1d2f..a604f6de 100644 --- a/common/dbus-helper.c +++ b/common/dbus-helper.c @@ -283,7 +283,7 @@ static DBusObjectPathVTable generic_table = { .message_function = generic_message, }; -static void update_parent_data(DBusConnection *conn, const char *child_path) +static void invalidate_parent_data(DBusConnection *conn, const char *child_path) { struct generic_data *data = NULL; char *parent_path, *slash; @@ -330,7 +330,7 @@ dbus_bool_t dbus_connection_create_object_path(DBusConnection *connection, return FALSE; } - update_parent_data(connection, path); + invalidate_parent_data(connection, path); return TRUE; } @@ -338,12 +338,9 @@ dbus_bool_t dbus_connection_create_object_path(DBusConnection *connection, dbus_bool_t dbus_connection_destroy_object_path(DBusConnection *connection, const char *path) { - if (!dbus_connection_unregister_object_path(connection, path)) - return FALSE; - - update_parent_data(connection, path); + invalidate_parent_data(connection, path); - return TRUE; + return dbus_connection_unregister_object_path(connection, path); } dbus_bool_t dbus_connection_get_object_user_data(DBusConnection *connection, |