diff options
author | Colin Walters <walters@verbum.org> | 2016-01-25 10:23:34 -0500 |
---|---|---|
committer | Colin Walters <walters@verbum.org> | 2016-01-25 10:23:34 -0500 |
commit | aac5a6cef72caa7cb26092db2923b70223005c6d (patch) | |
tree | b467c06f30927e5ca843c92ff3283a04f6528170 /glnx-console.h | |
parent | 2ca280f0124eddcac8aa868fdbeb679bb6e57139 (diff) | |
download | libglnx-aac5a6cef72caa7cb26092db2923b70223005c6d.tar.gz |
console: g_auto() macro no-ops if console is not locked
Otherwise we miss a lot of the ergonomics of cleanup macros.
Diffstat (limited to 'glnx-console.h')
-rw-r--r-- | glnx-console.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/glnx-console.h b/glnx-console.h index 9f620cc..8fc3865 100644 --- a/glnx-console.h +++ b/glnx-console.h @@ -45,7 +45,8 @@ guint glnx_console_columns (void); static inline void glnx_console_ref_cleanup (GLnxConsoleRef *p) { - glnx_console_unlock (p); + if (p->locked) + glnx_console_unlock (p); } G_DEFINE_AUTO_CLEANUP_CLEAR_FUNC(GLnxConsoleRef, glnx_console_ref_cleanup) |