[gnome-builder] clang: handle failed translation unit when notifying waiters
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder] clang: handle failed translation unit when notifying waiters
- Date: Mon, 30 Mar 2015 00:26:07 +0000 (UTC)
commit 9cba746e09046b07ac8eb0b7379eb5d63a2ee211
Author: Christian Hergert <christian hergert me>
Date: Sun Mar 29 17:26:00 2015 -0700
clang: handle failed translation unit when notifying waiters
libide/clang/ide-clang-service.c | 12 ++++++++++--
1 files changed, 10 insertions(+), 2 deletions(-)
---
diff --git a/libide/clang/ide-clang-service.c b/libide/clang/ide-clang-service.c
index c06f4ee..ea88c81 100644
--- a/libide/clang/ide-clang-service.c
+++ b/libide/clang/ide-clang-service.c
@@ -190,7 +190,7 @@ ide_clang_service_notify_waiters_locked (IdeClangService *self,
g_assert (IDE_IS_CLANG_SERVICE (self));
g_assert (IDE_IS_FILE (file));
- g_assert (IDE_IS_CLANG_TRANSLATION_UNIT (result));
+ g_assert (!result || IDE_IS_CLANG_TRANSLATION_UNIT (result));
for (i = 0; i < self->waiting->len; i++)
{
@@ -205,7 +205,15 @@ ide_clang_service_notify_waiters_locked (IdeClangService *self,
g_ptr_array_remove (self->waiting, iter->data);
for (iter = tasks; iter; iter = iter->next)
- g_task_return_pointer (iter->data, g_object_ref (result), g_object_unref);
+ {
+ if (result != NULL)
+ g_task_return_pointer (iter->data, g_object_ref (result), g_object_unref);
+ else
+ g_task_return_new_error (iter->data,
+ G_IO_ERROR,
+ G_IO_ERROR_FAILED,
+ _("Failed to compile translation unit"));
+ }
g_list_free_full (tasks, (GDestroyNotify)g_object_unref);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]