diff options
author | nyamatongwe <unknown> | 2010-06-11 10:13:48 +0000 |
---|---|---|
committer | nyamatongwe <unknown> | 2010-06-11 10:13:48 +0000 |
commit | 33c3c9ad43c88c570d3dbc8536750cfa1bca4fd4 (patch) | |
tree | 5c79eaaee86313ca69ff14a53bf60e7a66b5592e | |
parent | e9e3ba249e7e3ad18b2091f7954a2b55cb024230 (diff) | |
download | scintilla-mirror-33c3c9ad43c88c570d3dbc8536750cfa1bca4fd4.tar.gz |
Ensure thread safety with idle callbacks in case application is multithreaded.
See http://library.gnome.org/devel/gdk/unstable/gdk-Threads.html#id2755107
-rw-r--r-- | gtk/ScintillaGTK.cxx | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/gtk/ScintillaGTK.cxx b/gtk/ScintillaGTK.cxx index a94cfcb13..dfe0c2f8b 100644 --- a/gtk/ScintillaGTK.cxx +++ b/gtk/ScintillaGTK.cxx @@ -2317,6 +2317,7 @@ int ScintillaGTK::TimeOut(ScintillaGTK *sciThis) { gboolean ScintillaGTK::IdleCallback(ScintillaGTK *sciThis) { // Idler will be automatically stopped, if there is nothing // to do while idle. + gdk_threads_enter(); bool ret = sciThis->Idle(); if (ret == false) { // FIXME: This will remove the idler from GTK, we don't want to @@ -2324,11 +2325,14 @@ gboolean ScintillaGTK::IdleCallback(ScintillaGTK *sciThis) { // returns false (although, it should be harmless). sciThis->SetIdle(false); } + gdk_threads_leave(); return ret; } gboolean ScintillaGTK::StyleIdle(ScintillaGTK *sciThis) { + gdk_threads_enter(); sciThis->IdleStyling(); + gdk_threads_leave(); // Idler will be automatically stopped return FALSE; } |