Re: [evolution-patches] about calendar factory!



On Mon, 2003-06-23 at 05:01, jack wrote:
> Rodrigo Moya wrote:
> 
> >On Thu, 2003-06-19 at 08:19, jack wrote:
> >  
> >
> >>JP & other calendar guys:
> >>         When I used the evolution (with hydrogen), I was confused by 
> >>the alarm-notify.
> >>when I exit the evolution, the hydrogen exit too, but the 
> >>evolution-alarm-notify did not exit.
> >>wehn i run evolution and hydrogen again, all the alarm i set can not work.
> >>    
> >>
> >
> >  
> >
> >>______________________________________________________________________
> >>Index: calendar/cal-client/cal-client.c
> >>===================================================================
> >>RCS file: /cvs/gnome/evolution/calendar/cal-client/cal-client.c,v
> >>retrieving revision 1.118
> >>diff -u -r1.118 cal-client.c
> >>--- calendar/cal-client/cal-client.c	4 Jun 2003 15:07:15 -0000	1.118
> >>+++ calendar/cal-client/cal-client.c	19 Jun 2003 03:50:41 -0000
> >>@@ -735,8 +735,10 @@
> >> 	CORBA_Environment ev;
> >> 	int i;
> >> 
> >>-	if (factories != NULL)
> >>-		return factories;
> >>+	if (factories != NULL) {
> >>+		g_list_free (factories);
> >>+		factories = NULL;
> >>+	}
> >> 
> >> 	CORBA_exception_init (&ev);
> >> 
> >>    
> >>
> >in this case, it's probably better to just not have 'factories' to be a
> >static variable, since we won't reuse it. So I would just make it not
> >static, and not even g_list_free it, since this is already done in
> >destroy_factories (priv->factories is the value returned by
> >get_factories).
> >  
> >
>      I found the destroy_factories can not be called  anywhere. the only 
> place to call  "destroy_facotries"
> be deleted.  
> 
the attached patch should do what I mean.

cheers
Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution/calendar/ChangeLog,v
retrieving revision 1.1797
diff -u -p -r1.1797 ChangeLog
--- ChangeLog	20 Jun 2003 14:36:16 -0000	1.1797
+++ ChangeLog	23 Jun 2003 11:39:03 -0000
@@ -1,3 +1,9 @@
+2003-06-22  Rodrigo Moya <rodrigo ximian com>
+
+	* cal-client/cal-client.c (get_factories): don't use a static GList,
+	since the value returned is freed in destroy_factories, making several
+	clients use a buggy GList if one of them happen to be destroyed.
+
 2003-06-19  Dan Winship  <danw ximian com>
 
 	* pcs/cal-backend.c (cal_backend_finalize): don't leak the
Index: cal-client/cal-client.c
===================================================================
RCS file: /cvs/gnome/evolution/calendar/cal-client/cal-client.c,v
retrieving revision 1.118
diff -u -p -r1.118 cal-client.c
--- cal-client/cal-client.c	4 Jun 2003 15:07:15 -0000	1.118
+++ cal-client/cal-client.c	23 Jun 2003 11:39:05 -0000
@@ -729,14 +729,11 @@ client_forget_password_cb (WombatClient 
 static GList *
 get_factories (void)
 {
-	static GList *factories = NULL;
+	GList *factories = NULL;
 	GNOME_Evolution_Calendar_CalFactory factory;
 	Bonobo_ServerInfoList *servers;
 	CORBA_Environment ev;
 	int i;
-
-	if (factories != NULL)
-		return factories;
 
 	CORBA_exception_init (&ev);
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]