[evolution-patches] unref the gconf client,avoid mem leak!
- From: jack <jack jia sun com>
- To: evolution-patches ximian com
- Subject: [evolution-patches] unref the gconf client,avoid mem leak!
- Date: Thu, 19 Jun 2003 11:35:04 +0800
JP & rodrigo:
The patch is used for unref the gconf client, I found the
similar patches commited to other module, I believe you should commit
this patch.
Best Regards
jack
Index: calendar//ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution/calendar/ChangeLog,v
retrieving revision 1.1792
diff -u -r1.1792 ChangeLog
--- calendar//ChangeLog 12 Jun 2003 11:16:33 -0000 1.1792
+++ calendar//ChangeLog 19 Jun 2003 03:15:21 -0000
@@ -1,3 +1,10 @@
+2003-06-10 Jack Jia <jack jia sun com>
+
+ * gui/alarm-notify/save.c (get_calendars_to_load): Unref the gconf client after we're finished.
+ * gui/itip-utils.c (itip_addresses_get): ditto
+ * pcs/cal-backend-util.c (cal_backend_mail_account_get_default): ditto
+ (cal_backend_mail_account_is_valid): ditto
+
2003-06-10 Rodrigo Moya <rodrigo ximian com>
Fixes #41582
Index: calendar//gui/itip-utils.c
===================================================================
RCS file: /cvs/gnome/evolution/calendar/gui/itip-utils.c,v
retrieving revision 1.78
diff -u -r1.78 itip-utils.c
--- calendar//gui/itip-utils.c 30 May 2003 17:35:10 -0000 1.78
+++ calendar//gui/itip-utils.c 19 Jun 2003 03:15:22 -0000
@@ -70,8 +70,13 @@
EAccountList *
itip_addresses_get (void)
{
+ GConfClient *gconf_client;
+
+ gconf_client = gconf_client_get_default();
if (accounts == NULL)
- accounts = e_account_list_new(gconf_client_get_default());
+ accounts = e_account_list_new(gconf_client);
+
+ g_object_unref (gconf_client);
return accounts;
}
Index: calendar//gui/alarm-notify/save.c
===================================================================
RCS file: /cvs/gnome/evolution/calendar/gui/alarm-notify/save.c,v
retrieving revision 1.13
diff -u -r1.13 save.c
--- calendar//gui/alarm-notify/save.c 7 Mar 2003 12:53:19 -0000 1.13
+++ calendar//gui/alarm-notify/save.c 19 Jun 2003 03:15:22 -0000
@@ -126,12 +126,14 @@
{
GSList *l, *n;
GPtrArray *uris;
+ GConfClient *gconf_client;
/* Getting the default value below is not necessarily an error, as we
* may not have saved the list of calendar yet.
*/
- l = gconf_client_get_list (gconf_client_get_default (), KEY_CALENDARS, GCONF_VALUE_STRING, NULL);
+ gconf_client = gconf_client_get_default ();
+ l = gconf_client_get_list (gconf_client, KEY_CALENDARS, GCONF_VALUE_STRING, NULL);
uris = g_ptr_array_new ();
while (l) {
n = l->next;
@@ -139,6 +141,8 @@
g_slist_free_1(l);
l = n;
}
+
+ g_object_unref (gconf_client);
return uris;
}
Index: calendar//pcs/cal-backend-util.c
===================================================================
RCS file: /cvs/gnome/evolution/calendar/pcs/cal-backend-util.c,v
retrieving revision 1.6
diff -u -r1.6 cal-backend-util.c
--- calendar//pcs/cal-backend-util.c 24 Feb 2003 02:59:24 -0000 1.6
+++ calendar//pcs/cal-backend-util.c 19 Jun 2003 03:15:22 -0000
@@ -62,9 +62,11 @@
char **name)
{
const EAccount *account;
+ GConfClient *gconf_client;
+ gconf_client = gconf_client_get_default ();
if (accounts == NULL)
- accounts = e_account_list_new(gconf_client_get_default());
+ accounts = e_account_list_new(gconf_client);
account = e_account_list_get_default(accounts);
if (account) {
@@ -72,6 +74,8 @@
*name = g_strdup(account->id->name);
}
+ g_object_unref (gconf_client);
+
return account != NULL;
}
@@ -79,13 +83,17 @@
cal_backend_mail_account_is_valid (EConfigListener *db, char *user, char **name)
{
const EAccount *account;
+ GConfClient *gconf_client;
+ gconf_client = gconf_client_get_default ();
if (accounts == NULL)
- accounts = e_account_list_new(gconf_client_get_default());
+ accounts = e_account_list_new(gconf_client);
account = e_account_list_find(accounts, E_ACCOUNT_FIND_ID_ADDRESS, user);
if (account)
*name = g_strdup(account->id->name);
+
+ g_object_unref (gconf_client);
return account != NULL;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]