From 0e37f409d529c8e354f5ba98611229ccc10d404e Mon Sep 17 00:00:00 2001 From: twinaphex Date: Wed, 1 Jul 2015 01:20:16 +0200 Subject: [PATCH] (runloop_msg.c) Cleanups --- runloop_msg.c | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/runloop_msg.c b/runloop_msg.c index a4a81db8cb..5edf47d3e1 100644 --- a/runloop_msg.c +++ b/runloop_msg.c @@ -67,33 +67,33 @@ void rarch_main_msg_queue_push(const char *msg, unsigned prio, unsigned duration void rarch_main_msg_queue_free(void) { - if (g_msg_queue) - { + if (!g_msg_queue) + return; + #ifdef HAVE_THREADS slock_lock(mq_lock); #endif - msg_queue_free(g_msg_queue); + msg_queue_free(g_msg_queue); #ifdef HAVE_THREADS - slock_unlock(mq_lock); - slock_free(mq_lock); + slock_unlock(mq_lock); + slock_free(mq_lock); #endif - } g_msg_queue = NULL; } void rarch_main_msg_queue_init(void) { - if (!g_msg_queue) - { - g_msg_queue = msg_queue_new(8); - rarch_assert(g_msg_queue); + if (g_msg_queue) + return; + + g_msg_queue = msg_queue_new(8); + rarch_assert(g_msg_queue); #ifdef HAVE_THREADS - mq_lock = slock_new(); - rarch_assert(mq_lock); + mq_lock = slock_new(); + rarch_assert(mq_lock); #endif - } }