From c6fc3eaafd375b8c007e6432efa01f11e31931c1 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Thu, 9 Jul 2015 00:17:20 +0200 Subject: [PATCH] (runloop_data.c) Some refactors --- runloop_data.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/runloop_data.c b/runloop_data.c index 5487d13000..5999cc07ec 100644 --- a/runloop_data.c +++ b/runloop_data.c @@ -101,10 +101,20 @@ void rarch_main_data_deinit(void) runloop->inited = false; } -void rarch_main_data_free(void) +static void rarch_main_data_free_internal(void) { data_runloop_t *runloop = rarch_main_data_get_ptr(); + if (!runloop) + return; + + if (runloop) + free(runloop); + runloop = NULL; +} + +void rarch_main_data_free(void) +{ rarch_main_data_nbio_uninit(); #ifdef HAVE_NETWORKING rarch_main_data_http_uninit(); @@ -113,9 +123,7 @@ void rarch_main_data_free(void) rarch_main_data_db_uninit(); #endif - if (runloop) - free(runloop); - runloop = NULL; + rarch_main_data_free_internal(); } static void data_runloop_iterate(bool is_thread)