Ocarina: Check for a current alsa device before setting
Otherwise we set a C++ string to NULL and it throws an exception... Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
This commit is contained in:
parent
9ead002ab8
commit
46ae66634e
|
@ -26,8 +26,12 @@ static void set_alsa_devices(bool using_alsa)
|
|||
|
||||
static void change_alsa_device(GtkComboBox *combo, gpointer data)
|
||||
{
|
||||
string device = gtk_combo_box_text_get_active_text(GTK_COMBO_BOX_TEXT(alsa_devices));
|
||||
libsaria::audio::set_device(device);
|
||||
char *device = gtk_combo_box_text_get_active_text(GTK_COMBO_BOX_TEXT(alsa_devices));
|
||||
if (device != NULL) {
|
||||
string dev = device;
|
||||
libsaria::audio::set_device(dev);
|
||||
g_free(device);
|
||||
}
|
||||
}
|
||||
|
||||
static void toggle_alsa(GtkWidget *button, gpointer data)
|
||||
|
|
Loading…
Reference in New Issue