[gvfs/gnome-2-28] Avoid crash on race to mount gvfstrash



commit 8d09266cc4f8fde049d304694bff302b4482980a
Author: Alexander Larsson <alexl redhat com>
Date:   Mon Jan 18 13:48:08 2010 +0100

    Avoid crash on race to mount gvfstrash
    
    If the trash is already mounted (due to e.g. a race) when registering the
    new trash backend we error out and free the trash backend. This caused
    the g_assert_not_reached() in trash_watcher_free to hit.
    (cherry picked from commit d618141ea5161d05e388e9fbfa4148a6abd976b1)

 daemon/trashlib/trashwatcher.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
---
diff --git a/daemon/trashlib/trashwatcher.c b/daemon/trashlib/trashwatcher.c
index a2cabfd..9661ce4 100644
--- a/daemon/trashlib/trashwatcher.c
+++ b/daemon/trashlib/trashwatcher.c
@@ -280,7 +280,10 @@ trash_watcher_new (TrashRoot *root)
 void
 trash_watcher_free (TrashWatcher *watcher)
 {
-  g_assert_not_reached ();
+  /* We just leak everything here, as this is not normally hit.
+     This used to be a g_assert_not_reached(), and that got hit when
+     mounting the trash backend failed due to the trash already being
+     mounted. */
 }
 
 void



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