aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorhiro <hiro@ee746299-78ed-0310-b773-934348b2243d>2009-10-02 04:45:08 +0000
committerhiro <hiro@ee746299-78ed-0310-b773-934348b2243d>2009-10-02 04:45:08 +0000
commit7fbfd588baf736f4f253b7c126348e21a3cd4591 (patch)
tree8b5d20bdb41ba51a89ec08ea650196642c5212c7 /src
parent7a7ab0907191055a1e94ffb441992187fd13cb34 (diff)
added missing locks on idle callbacks.
git-svn-id: svn://sylpheed.sraoss.jp/sylpheed/trunk@2267 ee746299-78ed-0310-b773-934348b2243d
Diffstat (limited to 'src')
-rw-r--r--src/folderview.c2
-rw-r--r--src/summaryview.c2
-rw-r--r--src/syldap.c8
-rw-r--r--src/trayicon.c2
4 files changed, 9 insertions, 5 deletions
diff --git a/src/folderview.c b/src/folderview.c
index b0976750..438080fa 100644
--- a/src/folderview.c
+++ b/src/folderview.c
@@ -1890,7 +1890,9 @@ static gboolean folderview_focus_idle_func(gpointer data)
{
FolderView *folderview = (FolderView *)data;
+ gdk_threads_enter();
GTK_WIDGET_SET_FLAGS(folderview->treeview, GTK_CAN_FOCUS);
+ gdk_threads_leave();
return FALSE;
}
diff --git a/src/summaryview.c b/src/summaryview.c
index 096869cf..af2451c8 100644
--- a/src/summaryview.c
+++ b/src/summaryview.c
@@ -5697,6 +5697,7 @@ static gboolean summary_display_msg_idle_func(gpointer data)
GtkTreePath *path;
GtkTreeIter iter;
+ gdk_threads_enter();
path = gtk_tree_row_reference_get_path(summaryview->selected);
if (path) {
gtk_tree_model_get_iter(GTK_TREE_MODEL(summaryview->store),
@@ -5704,6 +5705,7 @@ static gboolean summary_display_msg_idle_func(gpointer data)
gtk_tree_path_free(path);
summary_display_msg(summaryview, &iter);
}
+ gdk_threads_leave();
return FALSE;
}
diff --git a/src/syldap.c b/src/syldap.c
index 036ea643..8e7bea9c 100644
--- a/src/syldap.c
+++ b/src/syldap.c
@@ -641,7 +641,9 @@ static gboolean syldap_display_search_results(SyldapServer *ldapServer)
{
/* NOTE: when this function is called the accompanying thread should
* already be terminated. */
+ gdk_threads_enter();
ldapServer->callBack(ldapServer);
+ gdk_threads_leave();
/* FIXME: match should know whether to free this SyldapServer stuff. */
g_free(ldapServer->thread);
ldapServer->thread = NULL;
@@ -673,11 +675,7 @@ gint syldap_read_data( SyldapServer *ldapServer ) {
ldapServer->busyFlag = FALSE;
if( ldapServer->callBack ) {
/* make the ui thread update the search results */
- /* TODO: really necessary to call gdk_threads_XXX()??? gtk_idle_add()
- * should do this - could someone check the GTK sources please? */
- gdk_threads_enter();
- ldapServer->idleId = gtk_idle_add((GtkFunction)syldap_display_search_results, ldapServer);
- gdk_threads_leave();
+ ldapServer->idleId = g_idle_add((GSourceFunc)syldap_display_search_results, ldapServer);
}
return ldapServer->retVal;
diff --git a/src/trayicon.c b/src/trayicon.c
index 9416141f..3d7bbb69 100644
--- a/src/trayicon.c
+++ b/src/trayicon.c
@@ -338,7 +338,9 @@ static gboolean trayicon_restore(gpointer data)
{
MainWindow *mainwin = (MainWindow *)data;
+ gdk_threads_enter();
mainwin->tray_icon = trayicon_create(mainwin);
+ gdk_threads_leave();
return FALSE;
}