summaryrefslogtreecommitdiffstats
path: root/gtk
diff options
context:
space:
mode:
authorjstebbins <[email protected]>2013-02-01 19:29:55 +0000
committerjstebbins <[email protected]>2013-02-01 19:29:55 +0000
commit478574ed1d6161a49212d29ff3911dfad15da5f3 (patch)
tree6e1c4f4884b1037b10a312cab68040a88111b594 /gtk
parenta47fd8fc599f9abf4e53bafe8cec33b1de466f0c (diff)
LinGui: fix crash caused by bug in newer versions of gtk2
GtkCombobBoxText is not initialized correctly by gtk2. Reading out it's current value fails and returns NULL. So explicitely initialize the text column value and guard against future bugs by checking return value. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@5231 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'gtk')
-rw-r--r--gtk/src/callbacks.c16
-rw-r--r--gtk/src/ghb.ui14
2 files changed, 11 insertions, 19 deletions
diff --git a/gtk/src/callbacks.c b/gtk/src/callbacks.c
index 8971e48a4..eb98553e3 100644
--- a/gtk/src/callbacks.c
+++ b/gtk/src/callbacks.c
@@ -833,12 +833,16 @@ dvd_device_changed_cb(GtkComboBoxText *combo, signal_user_data_t *ud)
gchar *name;
dialog = GHB_WIDGET(ud->builder, "source_dialog");
- device = gtk_combo_box_text_get_active_text (combo);
- name = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER(dialog));
- if (name == NULL || strcmp(name, device) != 0)
- gtk_file_chooser_select_filename (GTK_FILE_CHOOSER(dialog), device);
- if (name != NULL)
- g_free(name);
+ device = gtk_combo_box_text_get_active_text(combo);
+ // Protext against unexpected NULL return value
+ if (device != NULL)
+ {
+ name = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER(dialog));
+ if (name == NULL || strcmp(name, device) != 0)
+ gtk_file_chooser_select_filename (GTK_FILE_CHOOSER(dialog), device);
+ if (name != NULL)
+ g_free(name);
+ }
}
}
diff --git a/gtk/src/ghb.ui b/gtk/src/ghb.ui
index 5228d4ce2..53e65b4cd 100644
--- a/gtk/src/ghb.ui
+++ b/gtk/src/ghb.ui
@@ -542,12 +542,6 @@
</popup>
</ui>
</object>
- <object class="GtkListStore" id="device_list">
- <columns>
- <!-- column-name device -->
- <column type="gchararray"/>
- </columns>
- </object>
<object class="GtkMenu" id="presets_menu">
<child>
@@ -8436,14 +8430,8 @@ libx264 authors:
<child>
<object class="GtkComboBoxText" id="source_device">
<property name="visible">True</property>
- <property name="model">device_list</property>
+ <property name="entry-text-column">0</property>
<signal handler="dvd_device_changed_cb" name="changed"/>
- <child>
- <object class="GtkCellRendererText" id="cellrenderertext1"/>
- <attributes>
- <attribute name="text">0</attribute>
- </attributes>
- </child>
</object>
</child>
</object>