diff --git a/addressbook/backends/groupwise/e-book-backend-groupwise.c b/addressbook/backends/groupwise/e-book-backend-groupwise.c
index 51ad5fb..e98b4d8 100644
--- a/addressbook/backends/groupwise/e-book-backend-groupwise.c
+++ b/addressbook/backends/groupwise/e-book-backend-groupwise.c
@@ -97,6 +97,8 @@ static struct {
 	DB_ENV *env;
 } global_env;
 
+#define d(x)
+
 #define CACHE_REFRESH_INTERVAL 600000
 #define ELEMENT_TYPE_SIMPLE 0x01
 #define ELEMENT_TYPE_COMPLEX 0x02 /* fields which require explicit functions to set values into EContact and EGwItem */
@@ -2142,6 +2144,7 @@ book_view_thread (gpointer data)
 
 	if (enable_debug)
 		printf ("start book view for %s \n", gwb->priv->book_name);
+	d(printf ("In EBookBackendGroupwise: book_view_thread START + %s + %p \n", e_data_book_view_get_card_query (book_view), book_view));
 	e_data_book_view_ref (book_view);
 	e_flag_set (closure->running);
 
@@ -2166,6 +2169,7 @@ book_view_thread (gpointer data)
 			}
 			if (ids)
 				g_ptr_array_free (ids, TRUE);
+			d(printf ("In EBookBackendGroupwise: book_view_thread FIRST STOP + %s + %p \n", e_data_book_view_get_card_query (book_view), book_view));
 			e_data_book_view_unref (book_view);
 			return NULL;
 		}
@@ -2188,6 +2192,7 @@ book_view_thread (gpointer data)
 			e_data_book_view_notify_complete (book_view, GNOME_Evolution_Addressbook_Success);
 		if (temp_list)
 			g_list_free (temp_list);
+		d(printf ("In EBookBackendGroupwise: book_view_thread SECOND STOP + %s + %p \n", e_data_book_view_get_card_query (book_view), book_view));
 		e_data_book_view_unref (book_view);
 		return NULL;
 
@@ -2196,6 +2201,7 @@ book_view_thread (gpointer data)
 		if (gwb->priv->cnc == NULL) {
 			e_data_book_view_notify_complete (book_view,
 							  GNOME_Evolution_Addressbook_AuthenticationRequired);
+			d(printf ("In EBookBackendGroupwise: book_view_thread THIRD STOP + %s + %p \n", e_data_book_view_get_card_query (book_view), book_view));
 			e_data_book_view_unref (book_view);
 			return NULL;
 		}
@@ -2225,6 +2231,7 @@ book_view_thread (gpointer data)
 		if (!gwb->priv->is_writable && !filter && (g_getenv ("GW_HIDE_SYSBOOK") || (!gwb->priv->is_cache_ready))) {
 
 				e_data_book_view_notify_complete (book_view, GNOME_Evolution_Addressbook_Success);
+				d(printf ("In EBookBackendGroupwise: book_view_thread FOURTH STOP + %s + %p \n", e_data_book_view_get_card_query (book_view), book_view));
 				e_data_book_view_unref (book_view);
 				if (filter)
 					g_object_unref (filter);
@@ -2260,6 +2267,7 @@ book_view_thread (gpointer data)
 										_("Searching..."));
 				get_contacts_from_cache (gwb, query, ids, book_view, closure);
 				g_ptr_array_free (ids, TRUE);
+				d(printf ("In EBookBackendGroupwise: book_view_thread FIFTH STOP + %s + %p \n", e_data_book_view_get_card_query (book_view), book_view));
 				e_data_book_view_unref (book_view);
 				if (enable_debug) {
 					g_get_current_time(&end);
@@ -2308,6 +2316,7 @@ book_view_thread (gpointer data)
 					e_data_book_view_notify_complete (book_view, GNOME_Evolution_Addressbook_Success);
 				if (temp_list)
 					g_list_free (temp_list);
+				d(printf ("In EBookBackendGroupwise: book_view_thread SIXTH STOP + %s  + %p \n", e_data_book_view_get_card_query (book_view), book_view));
 				e_data_book_view_unref (book_view);
 
 				if (filter)
@@ -2342,6 +2351,7 @@ book_view_thread (gpointer data)
 
 		if (status != E_GW_CONNECTION_STATUS_OK) {
 			e_data_book_view_notify_complete (book_view, GNOME_Evolution_Addressbook_OtherError);
+			d(printf ("In EBookBackendGroupwise: book_view_thread SEVENTH STOP + %s + %p \n", e_data_book_view_get_card_query (book_view), book_view));
 			e_data_book_view_unref (book_view);
 			if (filter)
 				g_object_unref (filter);
@@ -2376,6 +2386,7 @@ book_view_thread (gpointer data)
 			e_data_book_view_notify_complete (book_view, GNOME_Evolution_Addressbook_Success);
 		if (filter)
 			g_object_unref (filter);
+		d(printf ("In EBookBackendGroupwise: book_view_thread EIGHTH STOP + %s + %p  \n", e_data_book_view_get_card_query (book_view), book_view));
 		e_data_book_view_unref (book_view);
 
 		if (enable_debug) {
@@ -2390,6 +2401,8 @@ book_view_thread (gpointer data)
 	default :
 		break;
 	}
+	
+	d(printf ("In EBookBackendGroupwise: book_view_thread NINTH STOP + %s + %p \n", e_data_book_view_get_card_query (book_view), book_view));
 	return NULL;
 }
 
@@ -2399,12 +2412,15 @@ e_book_backend_groupwise_start_book_view (EBookBackend  *backend,
 {
 	GroupwiseBackendSearchClosure *closure = init_closure (book_view, E_BOOK_BACKEND_GROUPWISE (backend));
 
+	d(printf ("In EBookBackendGroupwise: start_book_view START + %s + %p \n", e_data_book_view_get_card_query (book_view), book_view));
+
 	if (enable_debug)
 		printf ("\ne_book_backend_groupwise_start_book_view...\n");
 	closure->thread = g_thread_create (book_view_thread, book_view, FALSE, NULL);
 	e_flag_wait (closure->running);
 
 	/* at this point we know the book view thread is actually running */
+	d(printf ("In EBookBackendGroupwise: start_book_view  END + %s + %p \n", e_data_book_view_get_card_query (book_view), book_view));
 }
 
 static void
@@ -2413,6 +2429,8 @@ e_book_backend_groupwise_stop_book_view (EBookBackend  *backend,
 {
 	GroupwiseBackendSearchClosure *closure = get_closure (book_view);
 
+	d(printf ("In EBookBackendGroupwise: start_book_view STOP + %s + %p \n", e_data_book_view_get_card_query (book_view), book_view));
+	
 	if (enable_debug)
 		printf ("\ne_book_backend_groupwise_stop_book_view...\n");
 	e_flag_clear (closure->running);
@@ -2439,36 +2457,6 @@ book_view_notify_status (EDataBookView *view, const gchar *status)
 	e_data_book_view_notify_status_message (view, status);
 }
 
-static EDataBookView *
-find_book_view (EBookBackendGroupwise *ebgw)
-{
-	EList *views = e_book_backend_get_book_views (E_BOOK_BACKEND (ebgw));
-	EIterator *iter;
-	EDataBookView *rv = NULL;
-
-	if (!views)
-		return NULL;
-
-	iter = e_list_get_iterator (views);
-
-	if (!iter) {
-		g_object_unref (views);
-		return NULL;
-	}
-
-	if (e_iterator_is_valid (iter)) {
-		/* just always use the first book view */
-		EDataBookView *v = (EDataBookView*)e_iterator_get(iter);
-		if (v)
-			rv = v;
-	}
-
-	g_object_unref (iter);
-	g_object_unref (views);
-
-	return rv;
-}
-
 static void
 get_sequence_from_cache (DB *db,
 		gdouble *cache_first_sequence,
@@ -2628,8 +2616,6 @@ build_cache (EBookBackendGroupwise *ebgw)
 	gboolean done = FALSE;
 	EBookBackendGroupwisePrivate *priv = ebgw->priv;
 	const gchar *position = E_GW_CURSOR_POSITION_START;
-	EDataBookView *book_view;
-	GroupwiseBackendSearchClosure *closure;
 	gchar *status_msg;
 	GTimeVal start, end;
 	GTimeVal tstart, tend;
@@ -2651,14 +2637,6 @@ build_cache (EBookBackendGroupwise *ebgw)
 		return NULL;
 	}
 
-	book_view = find_book_view (ebgw);
-	if (book_view) {
-		closure = get_closure (book_view);
-		e_data_book_view_ref (book_view);
-		if (closure)
-			e_flag_set (closure->running);
-	}
-
 	while (!done) {
 
 		if (enable_debug)
@@ -2691,12 +2669,10 @@ build_cache (EBookBackendGroupwise *ebgw)
 			 * Also we should be using "percent" in notify_progress() instead of
 			 * forming the message like this.
 			 */
-			if (book_view) {
-				status_msg = g_strdup_printf (_("Downloading contacts (%d)... "),
+			status_msg = g_strdup_printf (_("Downloading contacts (%d)... "),
 								 contact_num);
-				book_view_notify_status (book_view, status_msg);
-				g_free (status_msg);
-			}
+			e_book_backend_foreach_view (E_BOOK_BACKEND (ebgw), book_view_notify_status, status_msg);
+			g_free (status_msg);
 
 			g_object_unref(contact);
 			g_object_unref (l->data);
@@ -2716,12 +2692,6 @@ build_cache (EBookBackendGroupwise *ebgw)
 
 	ebgw->priv->file_db->sync(ebgw->priv->file_db, 0);
 
-	if (book_view) {
-		e_data_book_view_notify_complete (book_view,
-						  GNOME_Evolution_Addressbook_Success);
-		e_data_book_view_unref (book_view);
-	}
-
 	e_gw_connection_destroy_cursor (priv->cnc, priv->container_id, cursor);
 
 	if (enable_debug) {
@@ -2785,8 +2755,6 @@ update_cache (EBookBackendGroupwise *ebgw)
 	const struct tm *tm;
 	struct stat buf;
 	gchar *cache_file_name;
-	EDataBookView *book_view;
-	GroupwiseBackendSearchClosure *closure;
 	GTimeVal start, end;
 	gulong diff;
 
@@ -2800,14 +2768,6 @@ update_cache (EBookBackendGroupwise *ebgw)
 		printf("updating cache for %s\n", ebgw->priv->book_name);
 	}
 
-	book_view = find_book_view (ebgw);
-	if (book_view) {
-		closure = get_closure (book_view);
-		e_data_book_view_ref (book_view);
-		if (closure)
-			e_flag_set (closure->running);
-	}
-
 	cache_file_name = e_book_backend_db_cache_get_filename(ebgw->priv->file_db);
 	g_stat (cache_file_name, &buf);
 	g_free (cache_file_name);
@@ -2821,8 +2781,6 @@ update_cache (EBookBackendGroupwise *ebgw)
 	status = e_gw_connection_get_items (ebgw->priv->cnc, ebgw->priv->container_id,
 					    "name email default members", filter, &gw_items);
 	if (status != E_GW_CONNECTION_STATUS_OK) {
-		if (book_view)
-			e_data_book_view_unref (book_view);
 		if (enable_debug)
 			printf("No connection with the server \n");
 		g_mutex_unlock (ebgw->priv->update_cache_mutex);
@@ -2840,12 +2798,11 @@ update_cache (EBookBackendGroupwise *ebgw)
 		id =  e_contact_get_const (contact, E_CONTACT_UID);
 
 		contact_num++;
-		if (book_view) {
-			status_msg = g_strdup_printf (_("Updating contacts cache (%d)... "),
-							 contact_num);
-			book_view_notify_status (book_view, status_msg);
-			g_free (status_msg);
-		}
+		
+		status_msg = g_strdup_printf (_("Updating contacts cache (%d)... "),
+				contact_num);
+		e_book_backend_foreach_view (E_BOOK_BACKEND (ebgw), book_view_notify_status, status_msg);
+		g_free (status_msg);
 
 		if (e_book_backend_db_cache_check_contact (ebgw->priv->file_db, id)) {
 			e_book_backend_db_cache_add_contact (ebgw->priv->file_db, contact);
@@ -2864,11 +2821,6 @@ update_cache (EBookBackendGroupwise *ebgw)
 
 	ebgw->priv->file_db->sync(ebgw->priv->file_db, 0);
 
-	if (book_view) {
-		e_data_book_view_notify_complete (book_view,
-						  GNOME_Evolution_Addressbook_Success);
-		e_data_book_view_unref (book_view);
-	}
 	g_object_unref (filter);
 	g_list_free (gw_items);
 
@@ -2893,8 +2845,6 @@ update_address_book_deltas (EBookBackendGroupwise *ebgw)
 	gboolean sync_required = FALSE;
 	GList *add_list = NULL, *delete_list = NULL;
 	EContact *contact;
-	EDataBookView *book_view;
-	GroupwiseBackendSearchClosure *closure;
 	EGwItem *item;
 	EBookBackendGroupwisePrivate *priv;
 
@@ -2960,14 +2910,6 @@ update_address_book_deltas (EBookBackendGroupwise *ebgw)
 	if (enable_debug)
 		g_get_current_time(&start);
 
-	book_view = find_book_view (ebgw);
-	if (book_view) {
-		closure = get_closure (book_view);
-		e_data_book_view_ref (book_view);
-		if (closure)
-			e_flag_set (closure->running);
-	}
-
 	/* update the cache */
 	sequence = g_strdup_printf ("%lf", cache_last_sequence +1);
 	count = g_strdup_printf ("%d", CURSOR_ITEM_LIMIT);
@@ -3024,12 +2966,11 @@ update_address_book_deltas (EBookBackendGroupwise *ebgw)
 				if (e_book_backend_db_cache_check_contact (ebgw->priv->file_db, id)) {
 					contact_num++;
 
-					if (book_view) {
-						status_msg = g_strdup_printf (_("Updating contacts cache (%d)... "),
-										 contact_num);
-						book_view_notify_status (book_view, status_msg);
-						g_free (status_msg);
-					}
+					status_msg = g_strdup_printf (_("Updating contacts cache (%d)... "),
+							contact_num);
+					e_book_backend_foreach_view (E_BOOK_BACKEND (ebgw), book_view_notify_status, status_msg);
+					g_free (status_msg);
+
 					e_book_backend_db_cache_remove_contact (ebgw->priv->file_db, id);
 					e_book_backend_summary_remove_contact (ebgw->priv->summary, id);
 				}
@@ -3072,12 +3013,12 @@ update_address_book_deltas (EBookBackendGroupwise *ebgw)
 				id =  e_contact_get_const (contact, E_CONTACT_UID);
 
 				contact_num++;
-				if (book_view) {
-					status_msg = g_strdup_printf (_("Updating contacts cache (%d)... "),
+					
+				status_msg = g_strdup_printf (_("Updating contacts cache (%d)... "),
 									 contact_num);
-					book_view_notify_status (book_view, status_msg);
-					g_free (status_msg);
-				}
+				e_book_backend_foreach_view (E_BOOK_BACKEND (ebgw), book_view_notify_status, status_msg);
+				g_free (status_msg);
+		
 				if (e_book_backend_db_cache_check_contact (ebgw->priv->file_db, id)) {
 					if (enable_debug)
 						printf("contact already there\n");
@@ -3113,12 +3054,6 @@ update_address_book_deltas (EBookBackendGroupwise *ebgw)
 	if (sync_required)
 		ebgw->priv->file_db->sync(ebgw->priv->file_db, 0);
 
-	if (book_view) {
-		e_data_book_view_notify_complete (book_view,
-						  GNOME_Evolution_Addressbook_Success);
-		e_data_book_view_unref (book_view);
-	}
-
 	if (enable_debug) {
 		g_get_current_time(&end);
 		diff = end.tv_sec * 1000 + end.tv_usec/1000;
diff --git a/addressbook/libedata-book/e-book-backend.c b/addressbook/libedata-book/e-book-backend.c
index 7ef6da8..0999556 100644
--- a/addressbook/libedata-book/e-book-backend.c
+++ b/addressbook/libedata-book/e-book-backend.c
@@ -530,6 +530,7 @@ e_book_backend_add_book_view (EBookBackend *backend,
 
 	g_mutex_lock (backend->priv->views_mutex);
 
+	e_data_book_view_ref (view);
 	e_list_append (backend->priv->views, view);
 
 	g_mutex_unlock (backend->priv->views_mutex);
@@ -551,6 +552,7 @@ e_book_backend_remove_book_view (EBookBackend *backend,
 	g_mutex_lock (backend->priv->views_mutex);
 
 	e_list_remove (backend->priv->views, view);
+	e_data_book_view_unref (view);
 
 	g_mutex_unlock (backend->priv->views_mutex);
 }
@@ -868,7 +870,7 @@ e_book_backend_change_delete_new  (const gchar *vcard)
 
 
 
-static void
+void
 e_book_backend_foreach_view (EBookBackend *backend,
 			     void (*callback) (EDataBookView *, gpointer),
 			     gpointer user_data)
@@ -877,18 +879,20 @@ e_book_backend_foreach_view (EBookBackend *backend,
 	EDataBookView *view;
 	EIterator *iter;
 
+	g_mutex_lock (backend->priv->views_mutex);
+	
 	views = e_book_backend_get_book_views (backend);
 	iter = e_list_get_iterator (views);
 
 	while (e_iterator_is_valid (iter)) {
 		view = (EDataBookView*)e_iterator_get (iter);
 
-		e_data_book_view_ref (view);
 		callback (view, user_data);
-		e_data_book_view_unref (view);
 
 		e_iterator_next (iter);
 	}
+	
+	g_mutex_unlock (backend->priv->views_mutex);
 
 	g_object_unref (iter);
 	g_object_unref (views);
diff --git a/addressbook/libedata-book/e-book-backend.h b/addressbook/libedata-book/e-book-backend.h
index 6ece62e..5763cc5 100644
--- a/addressbook/libedata-book/e-book-backend.h
+++ b/addressbook/libedata-book/e-book-backend.h
@@ -167,6 +167,10 @@ void        e_book_backend_remove_book_view           (EBookBackend           *b
 
 EList      *e_book_backend_get_book_views             (EBookBackend           *backend);
 
+void	     e_book_backend_foreach_view		(EBookBackend		*backend,
+							void (*callback)	(EDataBookView *, gpointer),
+							gpointer		user_data);
+
 void        e_book_backend_notify_update              (EBookBackend           *backend,
 						       EContact               *contact);
 void        e_book_backend_notify_remove              (EBookBackend           *backend,
diff --git a/addressbook/libedata-book/e-data-book-view.c b/addressbook/libedata-book/e-data-book-view.c
index 94ef8a6..47d2ca1 100644
--- a/addressbook/libedata-book/e-data-book-view.c
+++ b/addressbook/libedata-book/e-data-book-view.c
@@ -43,6 +43,9 @@ struct _EDataBookViewPrivate {
 	EBookBackendSExp *card_sexp;
 	GHashTable *ids;
 
+	EDataBookViewDisposeNotify callback;
+	gpointer callback_data;
+
 	gint max_results;
 };
 
@@ -50,6 +53,8 @@ static void
 view_listener_died_cb (gpointer cnx, gpointer user_data)
 {
 	EDataBookView *book_view = E_DATA_BOOK_VIEW (user_data);
+	
+	d(printf("In EDataBookView: view_listener_died_cb + %s \n", book_view->priv->card_query));
 
 	if (book_view) {
 		e_book_backend_stop_book_view (e_data_book_view_get_backend (book_view), book_view);
@@ -506,12 +511,29 @@ impl_GNOME_Evolution_Addressbook_BookView_dispose (PortableServer_Servant servan
 {
 	EDataBookView *view = E_DATA_BOOK_VIEW (bonobo_object (servant));
 
-	d(printf("in impl_GNOME_Evolution_Addressbook_BookView_dispose\n"));
+	d(printf("in impl_GNOME_Evolution_Addressbook_BookView_dispose + %s + %p \n", view->priv->card_query, view));
 	ORBit_small_unlisten_for_broken (e_data_book_view_get_listener (view), G_CALLBACK (view_listener_died_cb));
 
+	if (view->priv->callback)
+		view->priv->callback (view, view->priv->callback_data);
+
 	bonobo_object_unref (view);
 }
 
+/* Would be called before destroying the view. 
+   weak_notify seems to be trigger on bonobo object only after the view has been destroyed.
+   This is primarily used for EDataBook to remove the views from EBookBackend.
+   Maybe this could also be implemented using GSignals
+ */
+void
+e_data_book_view_set_dispose_callback (EDataBookView *book_view, EDataBookViewDisposeNotify callback, gpointer user_data)
+{
+	g_return_if_fail (E_IS_DATA_BOOK_VIEW (book_view));
+
+	book_view->priv->callback = callback;
+	book_view->priv->callback_data = user_data;
+}
+
 /**
  * e_data_book_view_get_card_query:
  * @book_view: an #EDataBookView
@@ -698,6 +720,7 @@ e_data_book_view_dispose (GObject *object)
 	EDataBookView *book_view = E_DATA_BOOK_VIEW (object);
 
 	d(printf ("disposing of EDataBookView\n"));
+	d(printf("in EDataBookView: Dipose START +  %p \n", book_view));
 	if (book_view->priv) {
 		bonobo_object_release_unref (book_view->priv->listener, NULL);
 
@@ -720,6 +743,8 @@ e_data_book_view_dispose (GObject *object)
 		g_free (book_view->priv);
 		book_view->priv = NULL;
 	}
+	
+	d(printf("in EDataBookView: Dipose END + %p \n", book_view));
 
 	if (G_OBJECT_CLASS (e_data_book_view_parent_class)->dispose)
 		G_OBJECT_CLASS (e_data_book_view_parent_class)->dispose (object);
diff --git a/addressbook/libedata-book/e-data-book-view.h b/addressbook/libedata-book/e-data-book-view.h
index 1bdfafa..fc39754 100644
--- a/addressbook/libedata-book/e-data-book-view.h
+++ b/addressbook/libedata-book/e-data-book-view.h
@@ -41,6 +41,8 @@ struct _EDataBookViewClass {
 	POA_GNOME_Evolution_Addressbook_BookView__epv epv;
 };
 
+typedef void (*EDataBookViewDisposeNotify) (EDataBookView *view, gpointer data);
+
 EDataBookView *e_data_book_view_new                  (EBookBackend                 *backend,
 						      GNOME_Evolution_Addressbook_BookViewListener  listener,
 						      const gchar                   *card_query,
@@ -75,6 +77,9 @@ void         e_data_book_view_notify_status_message  (EDataBookView
 						      const gchar                   *message);
 void         e_data_book_view_ref                    (EDataBookView                *book_view);
 void         e_data_book_view_unref                  (EDataBookView                *book_view);
+void	     e_data_book_view_set_dispose_callback   (EDataBookView *book_view, 
+		                                      EDataBookViewDisposeNotify callback, 
+						      gpointer user_data);
 
 GType        e_data_book_view_get_type               (void);
 
diff --git a/addressbook/libedata-book/e-data-book.c b/addressbook/libedata-book/e-data-book.c
index 224cd89..35be02a 100644
--- a/addressbook/libedata-book/e-data-book.c
+++ b/addressbook/libedata-book/e-data-book.c
@@ -18,6 +18,8 @@
 #include "e-book-backend-sexp.h"
 #include "e-data-book.h"
 
+#define d(x)
+
 static BonoboObjectClass *e_data_book_parent_class;
 POA_GNOME_Evolution_Addressbook_Book__vepv e_data_book_vepv;
 
@@ -618,10 +620,13 @@ e_data_book_respond_get_supported_auth_methods (EDataBook
 }
 
 static void
-view_destroy(gpointer data, GObject *where_object_was)
+view_destroy(EDataBookView *view, gpointer user_data)
 {
-	EDataBook           *book = (EDataBook *)data;
-	e_book_backend_remove_book_view (book->priv->backend, (EDataBookView*)where_object_was);
+	EDataBook           *book = (EDataBook *) user_data;	
+	
+	d(printf ("EDataBook: view_destroy + %s + %p \n", e_data_book_view_get_card_query (view), view));
+	e_book_backend_remove_book_view (book->priv->backend, view);
+	bonobo_object_unref (book);
 }
 
 /**
@@ -650,7 +655,8 @@ e_data_book_respond_get_book_view (EDataBook                              *book,
 	if (book_view) {
 		object = bonobo_object_corba_objref(BONOBO_OBJECT(book_view));
 
-		g_object_weak_ref (G_OBJECT (book_view), view_destroy, book);
+		bonobo_object_ref (book);
+		e_data_book_view_set_dispose_callback (book_view, view_destroy, book);
 	}
 
 	GNOME_Evolution_Addressbook_BookListener_notifyViewRequested (
diff --git a/servers/groupwise/e-gw-filter.c b/servers/groupwise/e-gw-filter.c
index 6cc9e18..24ecc1f 100644
--- a/servers/groupwise/e-gw-filter.c
+++ b/servers/groupwise/e-gw-filter.c
@@ -256,7 +256,9 @@ GType
 e_gw_filter_get_type (void)
 {
 	static GType type = 0;
+	static GStaticMutex registering = G_STATIC_MUTEX_INIT;
 
+	g_static_mutex_lock (&registering);
 	if (!type) {
 		static GTypeInfo info = {
 			sizeof (EGwFilterClass),
@@ -270,6 +272,7 @@ e_gw_filter_get_type (void)
 		};
 		type = g_type_register_static (G_TYPE_OBJECT, "EGwFilter", &info, 0);
 	}
+	g_static_mutex_unlock (&registering);
 
 	return type;
 }
