[gnome-builder] clang: make sure file_copy is always set



commit 8041a47d60c4dda012e614f79674cda554d1b8de
Author: Christian Hergert <christian hergert me>
Date:   Sun Mar 29 17:20:11 2015 -0700

    clang: make sure file_copy is always set
    
    We hit a goto that caused this to assert as it was unset. Make sure
    we ref the instance before any failures can occur.

 libide/clang/ide-clang-service.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/libide/clang/ide-clang-service.c b/libide/clang/ide-clang-service.c
index 58b43fc..c06f4ee 100644
--- a/libide/clang/ide-clang-service.c
+++ b/libide/clang/ide-clang-service.c
@@ -235,6 +235,8 @@ ide_clang_service_parse_worker (GTask        *task,
   g_assert (IDE_IS_CLANG_SERVICE (source_object));
   g_assert (!cancellable || G_IS_CANCELLABLE (cancellable));
 
+  file_copy = g_object_ref (request->file);
+
   ar = g_array_new (FALSE, FALSE, sizeof (struct CXUnsavedFile));
 
   for (i = 0; i < request->unsaved_files->len; i++)
@@ -314,8 +316,6 @@ ide_clang_service_parse_worker (GTask        *task,
                         g_object_ref (ret));
   g_rw_lock_writer_unlock (&self->cached_rwlock);
 
-  file_copy = g_object_ref (request->file);
-
   g_task_return_pointer (task, g_object_ref (ret), g_object_unref);
 
 cleanup:


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]