PATCH: leaks in event source
- From: Richard Hult <rhult hem passagen se>
- To: gnome-components-list gnome org
- Subject: PATCH: leaks in event source
- Date: 14 Aug 2001 22:34:29 +0200
The attached patches fixes two leaks in bonobo-event-source.c (stable
and libbonobo). It seems I can't access gnomecvs right now. Can someone
(Michael?) commit those please?
/Richard
Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/bonobo/ChangeLog,v
retrieving revision 1.1087
diff -u -b -B -p -r1.1087 ChangeLog
--- ChangeLog 2001/07/30 13:58:46 1.1087
+++ ChangeLog 2001/08/14 20:12:38
@@ -1,3 +1,11 @@
+2001-08-14 Richard Hult <rhult codefactory se>
+
+ * bonobo/bonobo-event-source.c
+ (bonobo_event_source_client_remove_listener): Use
+ bonobo_object_release_unref instead of just Bonobo_Unknown_unref,
+ otherwise we'll leak a CORBA object reference.
+ (bonobo_event_source_client_add_listener): Likewise.
+
2001-07-30 Richard Hult <rhult codefactory se>
* configure.in (BONOBO_LIBS): Add gnome and gtk, remove gnomeui
Index: bonobo/bonobo-event-source.c
===================================================================
RCS file: /cvs/gnome/bonobo/bonobo/bonobo-event-source.c,v
retrieving revision 1.27
diff -u -b -B -p -r1.27 bonobo-event-source.c
--- bonobo/bonobo-event-source.c 2001/06/04 17:28:01 1.27
+++ bonobo/bonobo-event-source.c 2001/08/14 20:12:39
@@ -354,7 +354,7 @@ bonobo_event_source_client_remove_listen
Bonobo_EventSource_removeListener (es, id, my_ev);
- Bonobo_Unknown_unref (es, my_ev);
+ bonobo_object_release_unref (es, my_ev);
}
remove_listener_end:
@@ -422,7 +422,7 @@ bonobo_event_source_client_add_listener
corba_listener, my_ev);
bonobo_object_unref (BONOBO_OBJECT (listener));
- Bonobo_Unknown_unref (es, my_ev);
+ bonobo_object_release_unref (es, my_ev);
}
add_listener_end:
Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/libbonobo/ChangeLog,v
retrieving revision 1.155
diff -u -b -B -p -r1.155 ChangeLog
--- ChangeLog 2001/08/14 19:43:36 1.155
+++ ChangeLog 2001/08/14 20:31:06
@@ -1,3 +1,13 @@
+2001-08-14 Richard Hult <rhult codefactory se>
+
+ * bonobo/bonobo-event-source.c
+ (bonobo_event_source_client_remove_listener): Use
+ bonobo_object_release_unref instead of just Bonobo_Unknown_unref,
+ otherwise we'll leak a CORBA object reference.
+ (bonobo_event_source_client_add_listener_full): Likewise, and also
+ make sure we release & unref when the listener closure can't be
+ created, instead of just returning from the function.
+
2001-08-14 Michael Meeks <michael ximian com>
* monikers/bonobo-moniker-ior.c
Index: bonobo/bonobo-event-source.c
===================================================================
RCS file: /cvs/gnome/libbonobo/bonobo/bonobo-event-source.c,v
retrieving revision 1.36
diff -u -b -B -p -r1.36 bonobo-event-source.c
--- bonobo/bonobo-event-source.c 2001/08/07 14:33:24 1.36
+++ bonobo/bonobo-event-source.c 2001/08/14 20:31:07
@@ -324,7 +324,7 @@ bonobo_event_source_client_remove_listen
Bonobo_EventSource_removeListener (es, listener, my_ev);
- Bonobo_Unknown_unref (es, my_ev);
+ bonobo_object_release_unref (es, my_ev);
}
if (!opt_ev) {
@@ -360,8 +360,10 @@ bonobo_event_source_client_add_listener_
if (BONOBO_EX (my_ev) || !es)
goto add_listener_end;
- if (!(listener = bonobo_listener_new_closure (event_callback)))
+ if (!(listener = bonobo_listener_new_closure (event_callback))) {
+ bonobo_object_release_unref (es, myev);
goto add_listener_end;
+ }
corba_listener = BONOBO_OBJREF (listener);
@@ -377,7 +379,7 @@ bonobo_event_source_client_add_listener_
bonobo_object_unref (BONOBO_OBJECT (listener));
/* FIXME: wtf. is this doing ? */
- Bonobo_Unknown_unref (es, my_ev);
+ bonobo_object_release_unref (es, my_ev);
add_listener_end:
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]