Another memory leak plugged

This commit is contained in:
Matthias Clasen 2008-09-15 20:40:25 +00:00
parent be6c204b17
commit 2462d86b28
2 changed files with 63 additions and 1 deletions

View File

@ -12,7 +12,7 @@
Summary: GNOME session manager
Name: gnome-session
Version: 2.23.92
Release: 3%{?dist}
Release: 4%{?dist}
URL: http://www.gnome.org
Source0: http://download.gnome.org/sources/gnome-session/2.23/%{name}-%{version}.tar.bz2
Source1: redhat-default-session
@ -71,6 +71,8 @@ Patch1: previous_id-leak.patch
Patch2: inhibitor-leak.patch
# http://bugzilla.gnome.org/show_bug.cgi?id=552302
Patch3: empty-string-leak.patch
# http://bugzilla.gnome.org/show_bug.cgi?id=552255
Patch4: ice-leak.patch
%description
@ -83,6 +85,7 @@ GNOME components and handles logout and saving the session.
%patch1 -p1 -b .previous_id-leak
%patch2 -p1 -b .inhibitor-leak
%patch3 -p1 -b .empty-string-leak
%patch4 -p0 -b .ice-leak
%build
@ -181,6 +184,9 @@ fi
%changelog
* Mon Sep 15 2008 Matthias Clasen <mclasen@redhat.com> - 2.23.92-4
- Plug memory leaks
* Sun Sep 14 2008 Matthias Clasen <mclasen@redhat.com> - 2.23.92-3
- Plug memory leaks

56
ice-leak.patch Normal file
View File

@ -0,0 +1,56 @@
Index: gnome-session/gsm-xsmp-client.c
===================================================================
--- gnome-session/gsm-xsmp-client.c (revision 5088)
+++ gnome-session/gsm-xsmp-client.c (working copy)
@@ -78,25 +78,37 @@ client_iochannel_watch (GIOChannel *c
GIOCondition condition,
GsmXSMPClient *client)
{
+ gboolean keep_going;
+ g_object_ref (client);
switch (IceProcessMessages (client->priv->ice_connection, NULL, NULL)) {
case IceProcessMessagesSuccess:
- return TRUE;
+ keep_going = TRUE;
+ break;
case IceProcessMessagesIOError:
g_debug ("GsmXSMPClient: IceProcessMessagesIOError on '%s'", client->priv->description);
gsm_client_set_status (GSM_CLIENT (client), GSM_CLIENT_FAILED);
+ /* Emitting "disconnected" will eventually cause
+ * IceCloseConnection() to be called.
+ */
gsm_client_disconnected (GSM_CLIENT (client));
- return FALSE;
+ keep_going = FALSE;
+ break;
case IceProcessMessagesConnectionClosed:
g_debug ("GsmXSMPClient: IceProcessMessagesConnectionClosed on '%s'",
client->priv->description);
- return FALSE;
+ client->priv->ice_connection = NULL;
+ keep_going = FALSE;
+ break;
default:
g_assert_not_reached ();
}
+ g_object_unref (client);
+
+ return keep_going;
}
/* Called if too much time passes between the initial connection and
@@ -621,7 +633,9 @@ gsm_xsmp_client_disconnect (GsmXSMPClien
if (client->priv->conn != NULL) {
SmsCleanUp (client->priv->conn);
- } else {
+ }
+
+ if (client->priv->ice_connection != NULL) {
IceCloseConnection (client->priv->ice_connection);
}