diff options
author | Michal Ratajsky <[email protected]> | 2015-12-10 13:50:33 +0100 |
---|---|---|
committer | Michal Ratajsky <[email protected]> | 2015-12-10 13:50:33 +0100 |
commit | b824b6aab1320762e6ffaaf2e8a12eb021762d98 (patch) | |
tree | ddd13d61ed623e44203bc94a28335a31e5e85b91 | |
parent | d62f85c3dc4f8de5fe5a59908cef705b9d0a3440 (diff) | |
download | libmatemixer-b824b6aab1320762e6ffaaf2e8a12eb021762d98.tar.bz2 libmatemixer-b824b6aab1320762e6ffaaf2e8a12eb021762d98.tar.xz |
alsa/oss: Correctly disconnect device signals
-rw-r--r-- | backends/alsa/alsa-backend.c | 10 | ||||
-rw-r--r-- | backends/oss/oss-backend.c | 6 |
2 files changed, 11 insertions, 5 deletions
diff --git a/backends/alsa/alsa-backend.c b/backends/alsa/alsa-backend.c index b778cf1..45bee15 100644 --- a/backends/alsa/alsa-backend.c +++ b/backends/alsa/alsa-backend.c @@ -435,17 +435,23 @@ remove_device_by_list_item (AlsaBackend *alsa, GList *item) device = ALSA_DEVICE (item->data); - g_signal_handlers_disconnect_by_data (G_OBJECT (device), alsa); + g_signal_handlers_disconnect_by_func (G_OBJECT (device), + G_CALLBACK (remove_device), + alsa); + /* May emit removed signals */ if (alsa_device_is_open (device) == TRUE) alsa_device_close (device); + g_signal_handlers_disconnect_by_data (G_OBJECT (device), + alsa); + alsa->priv->devices = g_list_delete_link (alsa->priv->devices, item); g_hash_table_remove (alsa->priv->devices_ids, ALSA_DEVICE_GET_ID (device)); - /* The list may and may not have been invalidate by device signals */ + /* The list may have been invalidated by device signals */ free_stream_list (alsa); g_signal_emit_by_name (G_OBJECT (alsa), diff --git a/backends/oss/oss-backend.c b/backends/oss/oss-backend.c index eb4d742..70b32be 100644 --- a/backends/oss/oss-backend.c +++ b/backends/oss/oss-backend.c @@ -537,11 +537,11 @@ remove_device_by_list_item (OssBackend *oss, GList *item) G_CALLBACK (remove_device), oss); + /* May emit removed signals */ if (oss_device_is_open (device) == TRUE) oss_device_close (device); - g_signal_handlers_disconnect_by_func (G_OBJECT (device), - G_CALLBACK (remove_stream), + g_signal_handlers_disconnect_by_data (G_OBJECT (device), oss); oss->priv->devices = g_list_delete_link (oss->priv->devices, item); @@ -554,7 +554,7 @@ remove_device_by_list_item (OssBackend *oss, GList *item) oss->priv->default_device = NULL; } - /* The list may and may not have been invalidate by device signals */ + /* The list may have been invalidated by device signals */ free_stream_list (oss); g_signal_emit_by_name (G_OBJECT (oss), |