[PATCH 5/5] Fix a potential segfault by not trying to do a double free on a GSource



---
 src/gpm-manager.c |    8 +-------
 1 files changed, 1 insertions(+), 7 deletions(-)

diff --git a/src/gpm-manager.c b/src/gpm-manager.c
index 330d1f3..446f125 100644
--- a/src/gpm-manager.c
+++ b/src/gpm-manager.c
@@ -174,19 +174,13 @@ gpm_manager_play_loop_timeout_cb (GpmManager *manager)
 static gboolean
 gpm_manager_play_stop_loop (GpmManager *manager)
 {
-	GSource *loop_source;
-
 	if (manager->priv->critical_alert_timeout_id == 0) {
 		egg_warning ("no sound loop present to stop");
 
 		return FALSE;
 	}
 
-	loop_source = g_main_context_find_source_by_id (g_main_context_default (),
-							manager->priv->critical_alert_timeout_id);
-
-	g_source_destroy (loop_source);
-	g_source_unref (loop_source);
+	g_source_remove (manager->priv->critical_alert_timeout_id);
 	ca_proplist_destroy (manager->priv->critical_alert_loop_props);
 
 	manager->priv->critical_alert_loop_props = NULL;
-- 
1.6.6.1


--=-qM7510WE3RtGBvxDkLoy
Content-Disposition: attachment; filename="0006-trivial-Fix-a-small-code-documentation-error.patch"
Content-Type: text/x-patch; name="0006-trivial-Fix-a-small-code-documentation-error.patch"; charset="UTF-8"
Content-Transfer-Encoding: 7bit



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]