ajwillia-ms pushed a commit to branch master.

http://git.enlightenment.org/tools/edi.git/commit/?id=e9b18c45607587b80c41a92dabb6484d76444427

commit e9b18c45607587b80c41a92dabb6484d76444427
Author: Andy Williams <[email protected]>
Date:   Fri Sep 9 16:19:33 2016 +0100

    syntax: Fix bad racey thread conditions
---
 src/bin/editor/edi_editor.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/bin/editor/edi_editor.c b/src/bin/editor/edi_editor.c
index 83b5942..203e7a3 100644
--- a/src/bin/editor/edi_editor.c
+++ b/src/bin/editor/edi_editor.c
@@ -358,10 +358,14 @@ static void
 _clang_load_errors(const char *path EINA_UNUSED, Edi_Editor *editor)
 {
    Elm_Code *code;
+   const char *filename;
    unsigned n = clang_getNumDiagnostics(editor->tx_unit);
    unsigned i = 0;
 
+   ecore_thread_main_loop_begin();
    code = elm_code_widget_code_get(editor->entry);
+   filename = elm_code_file_path_get(code->file);
+   ecore_thread_main_loop_end();
 
    for(i = 0, n = clang_getNumDiagnostics(editor->tx_unit); i != n; ++i)
      {
@@ -374,7 +378,7 @@ _clang_load_errors(const char *path EINA_UNUSED, Edi_Editor 
*editor)
         clang_getSpellingLocation(clang_getDiagnosticLocation(diag), &file, 
&line, NULL, NULL);
 
         path = clang_getFileName(file);
-        if (!clang_getCString(path) || 
strcmp(elm_code_file_path_get(code->file), clang_getCString(path)))
+        if (!clang_getCString(path) || strcmp(filename, 
clang_getCString(path)))
           continue;
 
         /* FIXME: Also handle ranges and fix suggestions. */

-- 


Reply via email to