Index: src/balsa-message.c
===================================================================
RCS file: /cvs/gnome/balsa/src/balsa-message.c,v
retrieving revision 1.174
diff -u -r1.174 balsa-message.c
--- src/balsa-message.c	2001/08/10 13:40:52	1.174
+++ src/balsa-message.c	2001/08/21 14:17:38
@@ -264,7 +264,33 @@
 
 }
 
+#ifdef BALSA_USE_THREADS
 static void
+lock_all(void)
+{
+    /* gdk lock is already held here: gdk_threads_enter() not needed */
+    /* lock all mailboxes here(?) */
+    libbalsa_lock_mutt();
+}
+static void
+unlock_all(void)
+{
+    libbalsa_unlock_mutt();
+    /* unlock all mailboxes here(?) */
+    gdk_threads_leave();
+}
+
+static void
+balsa_gnome_url_show(const gchar* url)
+{
+    pthread_atfork(lock_all, unlock_all, unlock_all);
+    gnome_url_show(url);
+}
+#else 
+#define balsa_gnome_url_show(s) gnome_url_show(s)
+#endif
+
+static void
 balsa_message_destroy(GtkObject * object)
 {
     BalsaMessage* bm = BALSA_MESSAGE(object);
@@ -1524,7 +1550,7 @@
 				 url->url);
 	gnome_appbar_set_status(balsa_app.appbar, notice);
 	g_free(notice);
-	gnome_url_show(url->url);
+	balsa_gnome_url_show(url->url);
 	break;
 //		    case URL_FTP: 
     case URL_MAILTO:
@@ -2264,7 +2290,7 @@
 static void
 balsa_gtk_html_link_clicked(GtkWidget *html, const gchar *url)
 {
-    gnome_url_show(url);
+    balsa_gnome_url_show(url);
 }
 #endif
 
