summaryrefslogtreecommitdiffstats
path: root/gtk
diff options
context:
space:
mode:
authorJohn Stebbins <[email protected]>2019-08-26 15:08:38 -0700
committerJohn Stebbins <[email protected]>2019-08-26 15:08:38 -0700
commitea9dc5178d4fa793305d84eb8112bfd4b07f7478 (patch)
tree39013e30fac9f3cecb7e9ffba4f1ee8637807fa2 /gtk
parent52eb74c60482e792cf2f2fe7e968b1f35fb4f27e (diff)
LinGui: plug memory leaks
Diffstat (limited to 'gtk')
-rw-r--r--gtk/src/audiohandler.c8
-rw-r--r--gtk/src/callbacks.c3
-rw-r--r--gtk/src/chapters.c3
-rw-r--r--gtk/src/queuehandler.c1
-rw-r--r--gtk/src/subtitlehandler.c6
5 files changed, 15 insertions, 6 deletions
diff --git a/gtk/src/audiohandler.c b/gtk/src/audiohandler.c
index b1cb97c4a..5863f5118 100644
--- a/gtk/src/audiohandler.c
+++ b/gtk/src/audiohandler.c
@@ -153,7 +153,7 @@ ghb_adjust_audio_rate_combos(signal_user_data_t *ud, GhbValue *asettings)
ghb_ui_update(ud, "AudioBitrate",
ghb_dict_get_value(asettings, "Bitrate"));
gdouble quality = get_ui_quality(asettings);
- ghb_ui_update(ud, "AudioTrackQualityX", ghb_double_value_new(quality));
+ ghb_ui_update(ud, "AudioTrackQualityX", ghb_double_value(quality));
ghb_ui_update(ud, "AudioSamplerate",
ghb_dict_get_value(asettings, "Samplerate"));
ghb_ui_update(ud, "AudioMixdown",
@@ -400,7 +400,7 @@ void ghb_sanitize_audio_tracks(signal_user_data_t *ud)
ghb_ui_update(ud, "AudioBitrate",
ghb_dict_get_value(asettings, "Bitrate"));
gdouble quality = get_ui_quality(asettings);
- ghb_ui_update(ud, "AudioTrackQualityX", ghb_double_value_new(quality));
+ ghb_ui_update(ud, "AudioTrackQualityX", ghb_double_value(quality));
ghb_ui_update(ud, "AudioSamplerate",
ghb_dict_get_value(asettings, "Samplerate"));
ghb_ui_update(ud, "AudioMixdown",
@@ -464,6 +464,7 @@ audio_update_dialog_widgets(signal_user_data_t *ud, GhbValue *asettings)
drc = ghb_dict_get_double(asettings, "DRC");
s_drc = get_drc_string(drc);
ghb_ui_update(ud, "AudioTrackDRCValue", ghb_string_value(s_drc));
+ free(s_drc);
ghb_ui_update(ud, "AudioTrackGainSlider",
ghb_dict_get_value(asettings, "Gain"));
gain = ghb_dict_get_double(asettings, "Gain");
@@ -473,9 +474,10 @@ audio_update_dialog_widgets(signal_user_data_t *ud, GhbValue *asettings)
int codec = ghb_settings_audio_encoder_codec(asettings, "Encoder");
quality = ghb_dict_get_double(asettings, "Quality");
qualityx = get_quality(codec, quality);
- ghb_ui_update(ud, "AudioTrackQualityX", ghb_double_value_new(qualityx));
+ ghb_ui_update(ud, "AudioTrackQualityX", ghb_double_value(qualityx));
s_quality = get_quality_string(codec, quality);
ghb_ui_update(ud, "AudioTrackQualityValue", ghb_string_value(s_quality));
+ free(s_quality);
// Setting a radio button to FALSE does not automatically make
// the other one TRUE
qe = ghb_audio_quality_enabled(asettings);
diff --git a/gtk/src/callbacks.c b/gtk/src/callbacks.c
index 1d1e64e60..67453cce5 100644
--- a/gtk/src/callbacks.c
+++ b/gtk/src/callbacks.c
@@ -2459,6 +2459,7 @@ ghb_update_summary_info(signal_user_data_t *ud)
def = ghb_dict_get_bool(subsettings, "Default");
g_string_append_printf(str, "\n%s", desc);
+ free(desc);
if (force)
{
g_string_append_printf(str, ", Forced Only");
@@ -4733,6 +4734,7 @@ when_complete_changed_cb(GtkWidget *widget, signal_user_data_t *ud)
{
GhbValue * value = ghb_widget_value(widget);
ghb_ui_update(ud, "QueueWhenComplete", value);
+ ghb_value_free(&value);
ghb_widget_to_setting (ud->prefs, widget);
@@ -4747,6 +4749,7 @@ queue_when_complete_changed_cb(GtkWidget *widget, signal_user_data_t *ud)
{
GhbValue * value = ghb_widget_value(widget);
ghb_ui_update(ud, "WhenComplete", value);
+ ghb_value_free(&value);
}
G_MODULE_EXPORT void
diff --git a/gtk/src/chapters.c b/gtk/src/chapters.c
index 336c0b9bd..4e81c4d71 100644
--- a/gtk/src/chapters.c
+++ b/gtk/src/chapters.c
@@ -101,6 +101,7 @@ create_chapter_row(int index, int64_t start, int64_t duration,
str = g_strdup_printf("%d", index);
label = gtk_label_new(str);
+ free(str);
gtk_label_set_width_chars(GTK_LABEL(label), 5);
gtk_label_set_xalign(GTK_LABEL(label), 0);
ghb_box_append_child(hbox, label);
@@ -108,6 +109,7 @@ create_chapter_row(int index, int64_t start, int64_t duration,
ghb_break_duration(start, &hh, &mm, &ss);
str = g_strdup_printf("%02d:%02d:%02d", hh, mm, ss);
label = gtk_label_new(str);
+ free(str);
gtk_label_set_width_chars(GTK_LABEL(label), 10);
gtk_label_set_xalign(GTK_LABEL(label), 1);
ghb_box_append_child(hbox, label);
@@ -115,6 +117,7 @@ create_chapter_row(int index, int64_t start, int64_t duration,
ghb_break_duration(duration, &hh, &mm, &ss);
str = g_strdup_printf("%02d:%02d:%02d", hh, mm, ss);
label = gtk_label_new(str);
+ free(str);
gtk_label_set_width_chars(GTK_LABEL(label), 10);
gtk_label_set_xalign(GTK_LABEL(label), 1);
ghb_box_append_child(hbox, label);
diff --git a/gtk/src/queuehandler.c b/gtk/src/queuehandler.c
index 5cacf9a8c..9ba93c9b7 100644
--- a/gtk/src/queuehandler.c
+++ b/gtk/src/queuehandler.c
@@ -588,6 +588,7 @@ queue_update_summary(GhbValue * queueDict, signal_user_data_t *ud)
def = ghb_dict_get_bool(subsettings, "Default");
g_string_append_printf(str, "%s%s", sep, desc);
+ free(desc);
if (force)
{
g_string_append_printf(str, _(", Forced Only"));
diff --git a/gtk/src/subtitlehandler.c b/gtk/src/subtitlehandler.c
index 4014b222c..fea0f0175 100644
--- a/gtk/src/subtitlehandler.c
+++ b/gtk/src/subtitlehandler.c
@@ -830,7 +830,7 @@ subtitle_forced_toggled_cb(GtkWidget *widget, signal_user_data_t *ud)
{
ghb_widget_to_setting(ud->settings, widget);
GhbValue *val = ghb_widget_value(widget);
- subtitle_update_setting(ghb_value_dup(val), "Forced", ud);
+ subtitle_update_setting(val, "Forced", ud);
}
G_MODULE_EXPORT void
@@ -841,7 +841,7 @@ subtitle_burned_toggled_cb(GtkWidget *widget, signal_user_data_t *ud)
ghb_widget_to_setting(ud->settings, widget);
GhbValue *val = ghb_widget_value(widget);
- subtitle_update_setting(ghb_value_dup(val), "Burn", ud);
+ subtitle_update_setting(val, "Burn", ud);
subsettings = subtitle_get_selected_settings(ud, &index);
if (subsettings != NULL)
{
@@ -862,7 +862,7 @@ subtitle_default_toggled_cb(GtkWidget *widget, signal_user_data_t *ud)
ghb_widget_to_setting(ud->settings, widget);
GhbValue *val = ghb_widget_value(widget);
- subtitle_update_setting(ghb_value_dup(val), "Default", ud);
+ subtitle_update_setting(val, "Default", ud);
subsettings = subtitle_get_selected_settings(ud, &index);
if (subsettings != NULL)
{