[Galago-commits] r2647 - in trunk/libgalago: . libgalago
galago-commits at freedesktop.org
galago-commits at freedesktop.org
Sun Apr 2 01:59:09 PST 2006
Author: chipx86
Date: 2006-04-02 01:58:59 -0800 (Sun, 02 Apr 2006)
New Revision: 2647
Modified:
trunk/libgalago/ChangeLog
trunk/libgalago/libgalago/galago-core.c
Log:
- Fix a memory leak. The replied message in _galago_dbus_core_add_service wasn't being unreffed.
- Condense some code.
Modified: trunk/libgalago/ChangeLog
===================================================================
--- trunk/libgalago/ChangeLog 2006-03-31 19:57:48 UTC (rev 2646)
+++ trunk/libgalago/ChangeLog 2006-04-02 09:58:59 UTC (rev 2647)
@@ -1,3 +1,10 @@
+Sun Apr 02 01:58:15 PST 2006 Christian Hammond <chipx86 at chipx86.com>
+
+ * libgalago/galago-core.c:
+ - Fix a memory leak. The replied message in
+ _galago_dbus_core_add_service wasn't being unreffed.
+ - Condense some code.
+
Fri Mar 31 11:56:33 PST 2006 Christian Hammond <chipx86 at chipx86.com>
* libgalago/galago-core.c:
Modified: trunk/libgalago/libgalago/galago-core.c
===================================================================
--- trunk/libgalago/libgalago/galago-core.c 2006-03-31 19:57:48 UTC (rev 2646)
+++ trunk/libgalago/libgalago/galago-core.c 2006-04-02 09:58:59 UTC (rev 2647)
@@ -316,7 +316,7 @@
{
_galago_dbus_unregister_connection_finish();
}
-
+
dbus_error_init(&error);
if (!dbus_bus_start_service_by_name(_core->dbus_conn,
@@ -717,7 +717,6 @@
{
g_warning("Unable to activate Galago service: %s", error.message);
dbus_error_free(&error);
-
dbus_error_init(&error);
service_activated = FALSE;
@@ -1290,7 +1289,7 @@
static void
_galago_dbus_unregister_connection_finish(void)
{
- galago_context_clear_objects(GALAGO_REMOTE);
+ galago_context_clear_objects(GALAGO_REMOTE);
galago_set_watch_all(FALSE);
@@ -1314,7 +1313,6 @@
static void
_galago_dbus_core_add_service(GalagoService *service)
{
- DBusConnection *dbus_conn;
DBusMessage *message, *reply;
DBusMessageIter iter;
const char *obj_path;
@@ -1328,8 +1326,6 @@
return;
}
- dbus_conn = galago_get_dbus_conn();
-
message = dbus_message_new_method_call(GALAGO_DBUS_SERVICE,
galago_get_client_obj_path(),
GALAGO_DBUS_CORE_INTERFACE,
@@ -1340,8 +1336,8 @@
galago_dbus_message_iter_append_object(&iter, GALAGO_OBJECT(service));
dbus_error_init(&error);
- reply = dbus_connection_send_with_reply_and_block(dbus_conn, message, -1,
- &error);
+ reply = dbus_connection_send_with_reply_and_block(galago_get_dbus_conn(),
+ message, -1, &error);
dbus_message_unref(message);
if (dbus_error_is_set(&error))
@@ -1354,14 +1350,13 @@
dbus_message_iter_init(reply, &iter);
dbus_message_iter_get_basic(&iter, &obj_path);
-
galago_object_set_dbus_path(GALAGO_OBJECT(service), obj_path);
+ dbus_message_unref(reply);
}
static void
_galago_dbus_core_remove_service(GalagoService *service)
{
- DBusConnection *dbus_conn;
DBusMessage *message;
DBusMessageIter iter;
@@ -1373,8 +1368,6 @@
return;
}
- dbus_conn = galago_get_dbus_conn();
-
message = dbus_message_new_method_call(GALAGO_DBUS_SERVICE,
galago_get_client_obj_path(),
GALAGO_DBUS_CORE_INTERFACE,
@@ -1387,14 +1380,13 @@
dbus_message_iter_init_append(message, &iter);
galago_dbus_message_iter_append_object(&iter, GALAGO_OBJECT(service));
- dbus_connection_send(dbus_conn, message, NULL);
+ dbus_connection_send(galago_get_dbus_conn(), message, NULL);
dbus_message_unref(message);
}
static void
_galago_dbus_core_add_person(GalagoPerson *person)
{
- DBusConnection *dbus_conn;
DBusMessage *message, *reply;
DBusMessageIter iter;
const char *obj_path, *uid;
@@ -1408,8 +1400,6 @@
return;
}
- dbus_conn = galago_get_dbus_conn();
-
message = dbus_message_new_method_call(GALAGO_DBUS_SERVICE,
galago_get_client_obj_path(),
GALAGO_DBUS_CORE_INTERFACE,
@@ -1421,8 +1411,8 @@
galago_dbus_message_iter_append_object(&iter, GALAGO_OBJECT(person));
dbus_error_init(&error);
- reply = dbus_connection_send_with_reply_and_block(dbus_conn, message, -1,
- &error);
+ reply = dbus_connection_send_with_reply_and_block(galago_get_dbus_conn(),
+ message, -1, &error);
dbus_message_unref(message);
if (dbus_error_is_set(&error))
@@ -1440,12 +1430,13 @@
galago_object_set_dbus_path(GALAGO_OBJECT(person), obj_path);
_galago_person_set_id(person, uid);
+
+ dbus_message_unref(reply);
}
static void
_galago_dbus_core_remove_person(GalagoPerson *person)
{
- DBusConnection *dbus_conn;
DBusMessage *message;
DBusMessageIter iter;
@@ -1457,8 +1448,6 @@
return;
}
- dbus_conn = galago_get_dbus_conn();
-
message = dbus_message_new_method_call(GALAGO_DBUS_SERVICE,
galago_get_client_obj_path(),
GALAGO_DBUS_CORE_INTERFACE,
@@ -1471,6 +1460,6 @@
dbus_message_iter_init_append(message, &iter);
galago_dbus_message_iter_append_object(&iter, GALAGO_OBJECT(person));
- dbus_connection_send(dbus_conn, message, NULL);
+ dbus_connection_send(galago_get_dbus_conn(), message, NULL);
dbus_message_unref(message);
}
More information about the galago-commits
mailing list