Re: [evolution-patches] fix for addressbook 43005



hm, you're right.  attached is a patch that adds the unref in the case
cardify_book == NULL.

Chris

On Mon, 2003-05-19 at 06:23, Dan Winship wrote:
> Looks like it leaks a ref to dest by not calling launch_cardify_query?
> 
> On Sun, 2003-05-18 at 03:55, Chris Toshok wrote:
> > Can't reproduce this, but it's clear from the code that if an error
> > occurs @book will be NULL in this function, so we guard against it.
> > 
> > Chris
> _______________________________________________
> Evolution-patches mailing list
> Evolution-patches lists ximian com
> http://lists.ximian.com/mailman/listinfo/evolution-patches
Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution/addressbook/ChangeLog,v
retrieving revision 1.1422
diff -u -r1.1422 ChangeLog
--- ChangeLog	19 May 2003 15:50:44 -0000	1.1422
+++ ChangeLog	19 May 2003 18:29:28 -0000
@@ -1,3 +1,9 @@
+2003-05-18  Chris Toshok  <toshok ximian com>
+
+	* backend/ebook/e-destination.c (use_default_book_cb): handle the
+	case where @book == NULL, which can happen if there was a problem
+	opening the default book.  Should fix #43005.
+	
 2003-05-19  Anna Marie Dirks  <anna ximian com>
 
 	* gui/contact-editor/e-contact-quick-add.c: Added HIG-appropriate
Index: backend/ebook/e-destination.c
===================================================================
RCS file: /cvs/gnome/evolution/addressbook/backend/ebook/e-destination.c,v
retrieving revision 1.56
diff -u -r1.56 e-destination.c
--- backend/ebook/e-destination.c	8 Apr 2003 17:21:11 -0000	1.56
+++ backend/ebook/e-destination.c	19 May 2003 18:29:28 -0000
@@ -1039,12 +1039,15 @@
 use_default_book_cb (EBook *book, gpointer closure)
 {
 	EDestination *dest = E_DESTINATION (closure);
-	if (dest->priv->cardify_book == NULL) {
+	if (book != NULL && dest->priv->cardify_book == NULL) {
 		dest->priv->cardify_book = book;
 		g_object_ref (book);
 	}
 	
-	launch_cardify_query (dest);
+	if (dest->priv->cardify_book)
+		launch_cardify_query (dest);
+	else
+		g_object_unref (dest);
 }
 
 


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