diff --git a/library/gkr-operation.c b/library/gkr-operation.c
index b345d79..481f2af 100644
--- a/library/gkr-operation.c
+++ b/library/gkr-operation.c
@@ -290,6 +290,16 @@ connect_to_service (void)
 			return NULL;
 		}
 
+		/* Make sure we initialize dbus thread primitives as apps may
+		 * (and do) call g-k in threads. This isn't 100% safe, because
+		 * someone might have been doing dbus calls before without
+		 * initializing threads. However, there is no safe solution to
+		 * this other than just making all such places initialze threads
+		 * (or port to GDBus), so we do it anyway. (GVfs does it too, so
+		 * most apps end up doing it that way.)
+		 */
+		dbus_threads_init_default ();
+
 		conn = dbus_bus_get_private (DBUS_BUS_SESSION, &derr);
 		if (conn == NULL) {
 			g_message ("couldn't connect to dbus session bus: %s", derr.message);
