aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTed Gould <ted@gould.cx>2011-07-12 10:55:10 -0500
committerTed Gould <ted@gould.cx>2011-07-12 10:55:10 -0500
commit522f3c07a04ba5a18c830db28054e93c5c7d4d38 (patch)
tree359a421e1c495b500d4a5c47d46191d26aad9ec7
parent3d6738fd9d121eb66fcaa1fd57f78dd9b4db378b (diff)
parent64c3e2e2ba1ddcaac62e6ec50f414abd51e6b3d9 (diff)
downloadlibayatana-indicator-522f3c07a04ba5a18c830db28054e93c5c7d4d38.tar.gz
libayatana-indicator-522f3c07a04ba5a18c830db28054e93c5c7d4d38.tar.bz2
libayatana-indicator-522f3c07a04ba5a18c830db28054e93c5c7d4d38.zip
* Fixing watchers hashtable to detect when we have none
* Fix testing so no tests are XFAIL anymore
-rw-r--r--debian/changelog4
-rw-r--r--libindicator/indicator-service.c20
-rw-r--r--tests/Makefile.am6
-rw-r--r--tests/session.conf.in2
4 files changed, 14 insertions, 18 deletions
diff --git a/debian/changelog b/debian/changelog
index a57f12b..a3b7905 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -4,8 +4,10 @@ libindicator (0.3.90-0ubuntu2~ppa1) UNRELEASED; urgency=low
* Fix signals with NULL entries in the loader
* Adding a comment for setting up debugging options
* Adding annotations for GIR files
+ * Fixing watchers hashtable to detect when we have none
+ * Fix testing so no tests are XFAIL anymore
- -- Ted Gould <ted@ubuntu.com> Tue, 12 Jul 2011 10:53:54 -0500
+ -- Ted Gould <ted@ubuntu.com> Tue, 12 Jul 2011 10:54:31 -0500
libindicator (0.3.90-0ubuntu1) oneiric; urgency=low
diff --git a/libindicator/indicator-service.c b/libindicator/indicator-service.c
index e5eaa5b..1b4bc8c 100644
--- a/libindicator/indicator-service.c
+++ b/libindicator/indicator-service.c
@@ -32,7 +32,7 @@ License along with this library. If not, see
#include "dbus-shared.h"
static void unwatch_core (IndicatorService * service, const gchar * name);
-static gboolean watchers_remove (gpointer key, gpointer value, gpointer user_data);
+static void watchers_remove (gpointer value);
static void bus_get_cb (GObject * object, GAsyncResult * res, gpointer user_data);
static GVariant * bus_watch (IndicatorService * service, const gchar * sender);
@@ -203,10 +203,9 @@ indicator_service_init (IndicatorService *self)
}
/* NOTE: We're using g_free here because that's what needs to
- happen, but you really should call watchers_remove first as well
- since that disconnects the signals. We can't do that with a callback
- here because there is no user data to pass the object as well. */
- priv->watchers = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, NULL);
+ happen and we're watchers_remove as well to clean up the dbus
+ watches we've setup. */
+ priv->watchers = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, watchers_remove);
priv->bus_cancel = g_cancellable_new();
g_bus_get(G_BUS_TYPE_SESSION,
@@ -225,7 +224,8 @@ indicator_service_dispose (GObject *object)
IndicatorServicePrivate * priv = INDICATOR_SERVICE_GET_PRIVATE(object);
if (priv->watchers != NULL) {
- g_hash_table_foreach_remove(priv->watchers, watchers_remove, object);
+ g_hash_table_destroy(priv->watchers);
+ priv->watchers = NULL;
}
if (priv->timeout != 0) {
@@ -407,11 +407,11 @@ bus_method_call (GDBusConnection * connection, const gchar * sender, const gchar
/* A function to remove the signals on a proxy before we destroy
it because in this case we've stopped caring. */
-static gboolean
-watchers_remove (gpointer key, gpointer value, gpointer user_data)
+static void
+watchers_remove (gpointer value)
{
g_bus_unwatch_name(GPOINTER_TO_UINT(value));
- return TRUE;
+ return;
}
/* This is the function that gets executed if we timeout
@@ -553,8 +553,6 @@ unwatch_core (IndicatorService * service, const gchar * name)
/* Remove us from the watcher list here */
gpointer watcher_item = g_hash_table_lookup(priv->watchers, name);
if (watcher_item != NULL) {
- /* Free the watcher */
- watchers_remove((gpointer)name, watcher_item, service);
g_hash_table_remove(priv->watchers, name);
} else {
/* Odd that we couldn't find the person, but, eh */
diff --git a/tests/Makefile.am b/tests/Makefile.am
index e78ac6b..f11a9d1 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -258,8 +258,6 @@ service-manager-connect-tester: service-manager-connect service-manager-connect-
TESTS += service-manager-connect-tester
DISTCLEANFILES += service-manager-connect-tester session.conf service-manager-connect.service
-# Bug 806690
-XFAIL_TESTS += service-manager-connect-tester
#############################
# Service Versions
@@ -323,8 +321,6 @@ service-version-tester: service-version-manager service-version-bad-service serv
TESTS += service-version-tester
DISTCLEANFILES += service-version-tester service-version-bad.service service-version-good.service
-# Bug 806691
-XFAIL_TESTS += service-version-tester
#############################
# Service Versions
@@ -382,8 +378,6 @@ service-version-multiwatch-tester: service-version-multiwatch-manager service-ve
TESTS += service-version-multiwatch-tester
DISTCLEANFILES += service-version-multiwatch-tester
-# Bug 806692
-XFAIL_TESTS += service-version-multiwatch-tester
#############################
# Service Manager Shutdown
diff --git a/tests/session.conf.in b/tests/session.conf.in
index d1e2805..5c0cf36 100644
--- a/tests/session.conf.in
+++ b/tests/session.conf.in
@@ -1,6 +1,8 @@
<!DOCTYPE busconfig PUBLIC "-//freedesktop//DTD D-Bus Bus Configuration 1.0//EN"
"http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">
<busconfig>
+ <type>session</type>
+
<!-- If we fork, keep the user's original umask to avoid affecting
the behavior of child processes. -->
<keep_umask/>