diff options
author | John Stebbins <[email protected]> | 2017-11-12 08:45:21 -0800 |
---|---|---|
committer | John Stebbins <[email protected]> | 2017-11-12 08:45:21 -0800 |
commit | 143e1e22333cfcaa5371d7a671ba0b5e51e1499d (patch) | |
tree | 8f22aec55e0cf572753644eaf0426c05b36bf1e9 | |
parent | 6a39b850949b6dff124f1891d44bf5f3f031f46c (diff) |
LinGui: don't free uninitialized things on exit
-rw-r--r-- | gtk/src/hb-backend.c | 9 | ||||
-rw-r--r-- | gtk/src/main.c | 9 |
2 files changed, 12 insertions, 6 deletions
diff --git a/gtk/src/hb-backend.c b/gtk/src/hb-backend.c index c2a2e556e..126146cd3 100644 --- a/gtk/src/hb-backend.c +++ b/gtk/src/hb-backend.c @@ -3207,9 +3207,12 @@ ghb_log_level_set(int level) void ghb_backend_close() { - hb_close(&h_live); - hb_close(&h_queue); - hb_close(&h_scan); + if (h_live != NULL) + hb_close(&h_live); + if (h_queue != NULL) + hb_close(&h_queue); + if (h_scan != NULL) + hb_close(&h_scan); hb_global_close(); } diff --git a/gtk/src/main.c b/gtk/src/main.c index 8270a58f5..f3f8e1523 100644 --- a/gtk/src/main.c +++ b/gtk/src/main.c @@ -1343,21 +1343,24 @@ main(int argc, char *argv[]) ghb_backend_close(); // Remove stderr redirection - g_source_remove(ud->stderr_src_id); + if (ud->stderr_src_id > 0) + g_source_remove(ud->stderr_src_id); ghb_value_free(&ud->queue); ghb_value_free(&ud->settings_array); ghb_value_free(&ud->prefs); ghb_value_free(&ud->globals); ghb_value_free(&ud->x264_priv); - g_io_channel_unref(ud->activity_log); + if (ud->activity_log != NULL) + g_io_channel_unref(ud->activity_log); ghb_settings_close(); ghb_resource_free(); #if !defined(_WIN32) notify_uninit(); #endif - g_object_unref(ud->builder); + if (ud->builder != NULL) + g_object_unref(ud->builder); g_free(ud->current_dvd_device); g_free(ud); |