diff options
-rw-r--r-- | bus/bus.c | 11 | ||||
-rw-r--r-- | bus/bus.h | 2 | ||||
-rw-r--r-- | bus/config-loader-expat.c | 10 | ||||
-rw-r--r-- | bus/config-loader-libxml.c | 14 | ||||
-rw-r--r-- | bus/config-parser.h | 2 | ||||
-rw-r--r-- | bus/test-launch-helper.c | 1 | ||||
-rw-r--r-- | bus/test-main.c | 2 | ||||
-rw-r--r-- | bus/test-system.c | 1 |
8 files changed, 38 insertions, 5 deletions
@@ -1664,3 +1664,14 @@ bus_context_check_security_policy (BusContext *context, _dbus_verbose ("security policy allowing message\n"); return TRUE; } + +/** + * Do not call this function unless you're about to exit(). It exists only to + * keep things like valgrind happy. + */ +void +bus_self_destruct (void) +{ + bus_config_self_destruct (); + dbus_shutdown (); +} @@ -125,4 +125,6 @@ dbus_bool_t bus_context_check_security_policy (BusContext DBusMessage *message, DBusError *error); +void bus_self_destruct (void); + #endif /* BUS_BUS_H */ diff --git a/bus/config-loader-expat.c b/bus/config-loader-expat.c index b571fda3..e3bb9cf4 100644 --- a/bus/config-loader-expat.c +++ b/bus/config-loader-expat.c @@ -292,3 +292,13 @@ bus_config_load (const DBusString *file, bus_config_parser_unref (parser); return NULL; } + +/** + * Do not call this function unless you're about to exit(). It exists only to + * keep things like valgrind happy. + */ +void +bus_config_self_destruct (void) +{ + /* nothing to do in this backend */ +} diff --git a/bus/config-loader-libxml.c b/bus/config-loader-libxml.c index c73a1815..7844a8e7 100644 --- a/bus/config-loader-libxml.c +++ b/bus/config-loader-libxml.c @@ -306,8 +306,6 @@ bus_config_load (const DBusString *file, goto failed; _dbus_string_free (&dirname); _dbus_string_free (&data); - if (is_toplevel) - xmlCleanupParser(); _DBUS_ASSERT_ERROR_IS_CLEAR (error); return parser; @@ -315,10 +313,18 @@ bus_config_load (const DBusString *file, _DBUS_ASSERT_ERROR_IS_SET (error); _dbus_string_free (&dirname); _dbus_string_free (&data); - if (is_toplevel) - xmlCleanupParser(); if (parser) bus_config_parser_unref (parser); _dbus_assert (reader == NULL); /* must go to reader_out first */ return NULL; } + +/** + * Do not call this function unless you're about to exit(). It exists only to + * keep things like valgrind happy. + */ +void +bus_config_self_destruct (void) +{ + xmlCleanupParser (); +} diff --git a/bus/config-parser.h b/bus/config-parser.h index ba5bf749..3de2eb70 100644 --- a/bus/config-parser.h +++ b/bus/config-parser.h @@ -84,4 +84,6 @@ BusConfigParser* bus_config_load (const DBusString *file, const BusConfigParser *parent, DBusError *error); +void bus_config_self_destruct (void); + #endif /* BUS_CONFIG_PARSER_H */ diff --git a/bus/test-launch-helper.c b/bus/test-launch-helper.c index ab36b6ec..85b9696d 100644 --- a/bus/test-launch-helper.c +++ b/bus/test-launch-helper.c @@ -136,6 +136,7 @@ main (int argc, char **argv) printf ("%s: Success\n", argv[0]); + bus_self_destruct (); return 0; #else /* DBUS_BUILD_TESTS */ diff --git a/bus/test-main.c b/bus/test-main.c index cab75306..7dae94c9 100644 --- a/bus/test-main.c +++ b/bus/test-main.c @@ -181,7 +181,7 @@ main (int argc, char **argv) printf ("%s: Success\n", argv[0]); - + bus_self_destruct (); return 0; #else /* DBUS_BUILD_TESTS */ diff --git a/bus/test-system.c b/bus/test-system.c index 56a7d4ea..b3beb348 100644 --- a/bus/test-system.c +++ b/bus/test-system.c @@ -97,6 +97,7 @@ main (int argc, char **argv) printf ("%s: Success\n", argv[0]); + bus_self_destruct (); return 0; #else /* DBUS_BUILD_TESTS */ |