[Goodies-commits] r4940 - in xfce4-radio-plugin/trunk: . panel-plugin
Stefan Ott
cockroach at xfce.org
Sun Jun 15 16:57:58 CEST 2008
Author: cockroach
Date: 2008-06-15 14:57:58 +0000 (Sun, 15 Jun 2008)
New Revision: 4940
Modified:
xfce4-radio-plugin/trunk/NEWS
xfce4-radio-plugin/trunk/panel-plugin/radio.c
xfce4-radio-plugin/trunk/panel-plugin/radio.h
Log:
Fixed a segfault on removing the plugin from the panel
Modified: xfce4-radio-plugin/trunk/NEWS
===================================================================
--- xfce4-radio-plugin/trunk/NEWS 2008-06-14 16:07:57 UTC (rev 4939)
+++ xfce4-radio-plugin/trunk/NEWS 2008-06-15 14:57:58 UTC (rev 4940)
@@ -1,6 +1,11 @@
Get the latest version of this plugin at http://goodies.xfce.org/
===============================================================================
+v0.3.1 (xx Jun 2008):
+=====================
+ * The "segfault yourself"-release
+ * The plugin would segfault when it was removed from the panel - fixed
+
v0.3.0 (14 Jun 2008):
=====================
* The "let's apply his patch and call it a new version"-release
Modified: xfce4-radio-plugin/trunk/panel-plugin/radio.c
===================================================================
--- xfce4-radio-plugin/trunk/panel-plugin/radio.c 2008-06-14 16:07:57 UTC (rev 4939)
+++ xfce4-radio-plugin/trunk/panel-plugin/radio.c 2008-06-15 14:57:58 UTC (rev 4940)
@@ -124,22 +124,21 @@
perror("VIDIOCGAUDIO");
if (vid_aud.flags & VIDEO_AUDIO_MUTE) {
- close(data->fd);
+ close(data->fd);
// Radio is off. Did I think it was on?
if (data->on) {
- // manually clean up; radio_stop would call ioctl
+ // manually clean up; radio_stop would call ioctl
if (data->show_signal)
gtk_widget_hide (data->signal_bar);
- data->on = 0;
+ data->on = FALSE;
}
} else {
// Radio is on. Did I think it was off?
if (!data->on) {
// manually clean up; radio_start would tune the radio
- gtk_tooltips_enable (data->tooltips);
-
- data->on = 1;
+ gtk_tooltips_enable (data->tooltips);
+ data->on = TRUE;
}
if (ioctl(data->fd, VIDIOCGFREQ, &freq)) {
@@ -152,10 +151,10 @@
freq /= data->freqfact;
data->freq = freq;
- }
+ }
update_label(data);
- update_signal_bar(data);
+ update_signal_bar(data);
return TRUE;
}
@@ -682,21 +681,16 @@
}
static void
-plugin_free (radio_gui *data)
+radio_free (XfcePanelPlugin *plugin, radio_gui *data)
{
if (data->on) radio_stop(data);
free_presets (data);
g_free (data);
- /* TODO: check this
-+
-+ // lex: I think this is necessary.
-+ if (data->signal_timeout_id)
-+ g_source_remove(data->signal_timeout_id);
-+ if (data->radio_timeout_id)
-+ g_source_remove(data->radio_timeout_id);
-+
- */
+ if (data->signal_timeout_id)
+ g_source_remove(data->signal_timeout_id);
+ if (data->radio_timeout_id)
+ g_source_remove(data->radio_timeout_id);
}
static radio_gui *
@@ -911,7 +905,7 @@
gtk_table_attach (GTK_TABLE (table), hbox, 1, 2, 2, 3, GTK_FILL,
GTK_FILL, 0, 0);
- frequency_button = gtk_radio_button_new_with_label (NULL,
+ frequency_button = gtk_radio_button_new_with_label (NULL,
_("frequency"));
gtk_widget_show (frequency_button);
gtk_box_pack_start (GTK_BOX (hbox), frequency_button, FALSE, FALSE, 0);
@@ -1063,7 +1057,7 @@
G_CALLBACK (radio_plugin_create_options), data);
g_signal_connect (plugin, "size-changed", G_CALLBACK
(radio_plugin_set_size), data);
- g_signal_connect (plugin, "free-data", G_CALLBACK (plugin_free), data);
+ g_signal_connect (plugin, "free-data", G_CALLBACK (radio_free), data);
g_signal_connect (plugin, "save", G_CALLBACK (write_config), data);
}
Modified: xfce4-radio-plugin/trunk/panel-plugin/radio.h
===================================================================
--- xfce4-radio-plugin/trunk/panel-plugin/radio.h 2008-06-14 16:07:57 UTC (rev 4939)
+++ xfce4-radio-plugin/trunk/panel-plugin/radio.h 2008-06-15 14:57:58 UTC (rev 4940)
@@ -60,7 +60,7 @@
GtkWidget* label;
GtkWidget* signal_bar;
GtkTooltips* tooltips;
-
+
int signal_timeout_id;
int radio_timeout_id;
More information about the Goodies-commits
mailing list