Skip to content
Snippets Groups Projects
Commit aac5a6ce authored by Colin Walters's avatar Colin Walters
Browse files

console: g_auto() macro no-ops if console is not locked

Otherwise we miss a lot of the ergonomics of cleanup macros.
parent 2ca280f0
No related branches found
No related tags found
No related merge requests found
...@@ -45,7 +45,8 @@ guint glnx_console_columns (void); ...@@ -45,7 +45,8 @@ guint glnx_console_columns (void);
static inline void static inline void
glnx_console_ref_cleanup (GLnxConsoleRef *p) 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) G_DEFINE_AUTO_CLEANUP_CLEAR_FUNC(GLnxConsoleRef, glnx_console_ref_cleanup)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment