Robustness fixes

This commit is contained in:
twinaphex 2015-03-22 00:29:30 +01:00
parent 16cce08fa7
commit 572b59d417
2 changed files with 10 additions and 1 deletions

View File

@ -1668,7 +1668,10 @@ static void free_temporary_content(void)
static void main_clear_state_drivers(void)
{
global_t *global = global_get_ptr();
bool inited = global->main_is_init;
bool inited = false;
if (!global)
return;
inited = global->main_is_init;
if (!inited)
return;

View File

@ -981,6 +981,9 @@ void rarch_main_msg_queue_push(const char *msg, unsigned prio, unsigned duration
void rarch_main_msg_queue_free(void)
{
runloop_t *runloop = rarch_main_get_ptr();
if (!runloop)
return;
if (runloop->msg_queue)
msg_queue_free(runloop->msg_queue);
runloop->msg_queue = NULL;
@ -989,6 +992,9 @@ void rarch_main_msg_queue_free(void)
void rarch_main_msg_queue_init(void)
{
runloop_t *runloop = rarch_main_get_ptr();
if (!runloop)
return;
if (!runloop->msg_queue)
rarch_assert(runloop->msg_queue = msg_queue_new(8));
}