[gnome-builder/gnome-builder-3-18] libide: add helper to remove GSource by id
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder/gnome-builder-3-18] libide: add helper to remove GSource by id
- Date: Tue, 13 Oct 2015 07:28:53 +0000 (UTC)
commit 2c0afd7f380076cbce1f68ca20158bffaa5a4224
Author: Christian Hergert <christian hergert me>
Date: Tue Sep 29 12:24:44 2015 -0700
libide: add helper to remove GSource by id
libide/ide-macros.h | 9 +++++++++
1 files changed, 9 insertions(+), 0 deletions(-)
---
diff --git a/libide/ide-macros.h b/libide/ide-macros.h
index 9617128..2226b04 100644
--- a/libide/ide-macros.h
+++ b/libide/ide-macros.h
@@ -37,6 +37,15 @@ G_BEGIN_DECLS
} \
} G_STMT_END
+#define ide_clear_source(src) \
+ G_STMT_START {\
+ if (*(src) != 0) { \
+ guint __src_handler_id = *(src); \
+ *(src) = 0; \
+ g_source_remove (__src_handler_id); \
+ } \
+ } G_STMT_END
+
static inline gboolean
ide_str_empty0 (const gchar *str)
{
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]