void shutdown() {
	while (!gpu_events.empty()) {
		process_events();

		// Don't do busy waiting...
		os_sleep(5);
	}

	for (auto query : query_objects) {
		gr_delete_query_object(query);
	}
	query_objects.clear();

	mainFrameTimer = nullptr;
	traceEventWriter = nullptr;

	initialized = false;
}
Example #2
0
void profile_deinit()
{
    if (Cmdline_profile_write_file)
    {
        if (profiling_file.is_open())
        {
            profiling_file.flush();
            profiling_file.close();
        }
    }
    if (Cmdline_json_profiling)
    {
        profile_dump_json_output();
        while (!pending_frame_data.empty()) {
            process_pending_data();
        }
    }

    for (auto obj : query_objects) {
        gr_delete_query_object(obj);
    }
    query_objects.clear();
    SCP_queue<int>().swap(free_query_objects);
}