diff --git a/runloop_data.c b/runloop_data.c index 6761e02fb2..8e7fd4759f 100644 --- a/runloop_data.c +++ b/runloop_data.c @@ -89,6 +89,7 @@ void rarch_main_data_free(void) data_runloop_t *runloop = rarch_main_data_get_ptr(); rarch_main_data_nbio_uninit(); + rarch_main_data_http_uninit(); if (runloop) free(runloop); diff --git a/tasks/task_http.c b/tasks/task_http.c index 4db357b9f2..253a288d13 100644 --- a/tasks/task_http.c +++ b/tasks/task_http.c @@ -507,6 +507,13 @@ void *rarch_main_data_http_conn_get_handle(void) return http->connection.handle; } +void rarch_main_data_http_uninit(void) +{ + if (http_ptr) + free(http_ptr); + http_ptr = NULL; +} + void rarch_main_data_http_init(void) { http_ptr = (http_handle_t*)calloc(1, sizeof(*http_ptr)); diff --git a/tasks/tasks.h b/tasks/tasks.h index 7df7d3cb1e..e2925cfd74 100644 --- a/tasks/tasks.h +++ b/tasks/tasks.h @@ -60,6 +60,8 @@ void *rarch_main_data_http_get_handle(void); void *rarch_main_data_http_conn_get_handle(void); +void rarch_main_data_http_uninit(void); + void rarch_main_data_http_init(void); void *rarch_main_data_http_get_ptr(void);