mirror of
https://github.com/libretro/RetroArch
synced 2025-03-25 16:44:01 +00:00
Set the global variable to NULL on free in driver.c and runloop.c
This commit is contained in:
parent
dfd6d464a8
commit
feef97f0df
8
driver.c
8
driver.c
@ -30,14 +30,14 @@
|
|||||||
#include "config.h"
|
#include "config.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static driver_t *g_driver;
|
static driver_t *g_driver = NULL;
|
||||||
|
|
||||||
void driver_free(void)
|
void driver_free(void)
|
||||||
{
|
{
|
||||||
driver_t *driver = driver_get_ptr();
|
if (g_driver)
|
||||||
|
free(g_driver);
|
||||||
|
|
||||||
if (driver)
|
g_driver = NULL;
|
||||||
free(driver);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static driver_t *driver_new(void)
|
static driver_t *driver_new(void)
|
||||||
|
12
runloop.c
12
runloop.c
@ -35,9 +35,8 @@
|
|||||||
#include "netplay.h"
|
#include "netplay.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static struct runloop *g_runloop;
|
static struct runloop *g_runloop = NULL;
|
||||||
|
static struct global *g_extern = NULL;
|
||||||
static struct global *g_extern;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* check_pause:
|
* check_pause:
|
||||||
@ -941,12 +940,11 @@ runloop_t *rarch_main_get_ptr(void)
|
|||||||
|
|
||||||
void rarch_main_state_free(void)
|
void rarch_main_state_free(void)
|
||||||
{
|
{
|
||||||
runloop_t *runloop = rarch_main_get_ptr();
|
if (!g_runloop)
|
||||||
|
|
||||||
if (!runloop)
|
|
||||||
return;
|
return;
|
||||||
|
|
||||||
free(runloop);
|
free(g_runloop);
|
||||||
|
g_runloop = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
void rarch_main_global_free(void)
|
void rarch_main_global_free(void)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user