static void obs_free_data(void) { struct obs_core_data *data = &obs->data; data->valid = false; obs_view_free(&data->main_view); blog(LOG_INFO, "Freeing OBS context data"); if (data->user_sources.num) blog(LOG_INFO, "\t%d user source(s) were remaining", (int)data->user_sources.num); while (data->user_sources.num) obs_source_remove(data->user_sources.array[0]); da_free(data->user_sources); FREE_OBS_LINKED_LIST(source); FREE_OBS_LINKED_LIST(output); FREE_OBS_LINKED_LIST(encoder); FREE_OBS_LINKED_LIST(display); FREE_OBS_LINKED_LIST(service); pthread_mutex_destroy(&data->user_sources_mutex); pthread_mutex_destroy(&data->sources_mutex); pthread_mutex_destroy(&data->displays_mutex); pthread_mutex_destroy(&data->outputs_mutex); pthread_mutex_destroy(&data->encoders_mutex); pthread_mutex_destroy(&data->services_mutex); }
void obs_view_destroy(obs_view_t *view) { if (view) { obs_view_free(view); bfree(view); } }