[gnome-media] Fix segfault when default sink goes away
- From: Bastien Nocera <hadess src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [gnome-media] Fix segfault when default sink goes away
- Date: Mon, 17 Aug 2009 18:39:46 +0000 (UTC)
commit 2bd35715bb1f9a4c0002c0e0e8602e7bbd2488dd
Author: Bastien Nocera <hadess hadess net>
Date: Mon Aug 17 18:53:12 2009 +0100
Fix segfault when default sink goes away
When the default sink goes away, the dead balance bar was
still getting updates about the state of the stream's
channel map.
gnome-volume-control/src/gvc-balance-bar.c | 14 +++++++++-----
1 files changed, 9 insertions(+), 5 deletions(-)
---
diff --git a/gnome-volume-control/src/gvc-balance-bar.c b/gnome-volume-control/src/gvc-balance-bar.c
index 3677d77..17b15d0 100644
--- a/gnome-volume-control/src/gvc-balance-bar.c
+++ b/gnome-volume-control/src/gvc-balance-bar.c
@@ -241,6 +241,8 @@ gvc_balance_bar_set_channel_map (GvcBalanceBar *bar,
g_return_if_fail (GVC_BALANCE_BAR (bar));
if (bar->priv->channel_map != NULL) {
+ g_signal_handlers_disconnect_by_func (G_OBJECT (bar->priv->channel_map),
+ on_channel_map_volume_changed, bar);
g_object_unref (bar->priv->channel_map);
}
bar->priv->channel_map = g_object_ref (map);
@@ -520,17 +522,19 @@ gvc_balance_bar_init (GvcBalanceBar *bar)
static void
gvc_balance_bar_finalize (GObject *object)
{
- GvcBalanceBar *balance_bar;
+ GvcBalanceBar *bar;
g_return_if_fail (object != NULL);
g_return_if_fail (GVC_IS_BALANCE_BAR (object));
- balance_bar = GVC_BALANCE_BAR (object);
+ bar = GVC_BALANCE_BAR (object);
- g_return_if_fail (balance_bar->priv != NULL);
+ g_return_if_fail (bar->priv != NULL);
- if (balance_bar->priv->channel_map != NULL) {
- g_object_unref (balance_bar->priv->channel_map);
+ if (bar->priv->channel_map != NULL) {
+ g_signal_handlers_disconnect_by_func (G_OBJECT (bar->priv->channel_map),
+ on_channel_map_volume_changed, bar);
+ g_object_unref (bar->priv->channel_map);
}
G_OBJECT_CLASS (gvc_balance_bar_parent_class)->finalize (object);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]