[gvfs] cdda: Disconnect uevent handler immediately
- From: Ondrej Holy <oholy src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gvfs] cdda: Disconnect uevent handler immediately
- Date: Fri, 27 Jan 2017 07:21:32 +0000 (UTC)
commit cd4f923ba11d06e3ac917f95cd33987d80987c0a
Author: Ondrej Holy <oholy redhat com>
Date: Thu Jan 26 15:57:35 2017 +0100
cdda: Disconnect uevent handler immediately
Uevent handler with "remove" action may be called multiple times,
which causes that g_vfs_backend_force_unmount is called several
times, which may lead to segfault. Disconnect the uevent handler
immediately after g_vfs_backend_force_unmount call.
https://bugzilla.gnome.org/show_bug.cgi?id=777794
daemon/gvfsbackendcdda.c | 6 +++++-
1 files changed, 5 insertions(+), 1 deletions(-)
---
diff --git a/daemon/gvfsbackendcdda.c b/daemon/gvfsbackendcdda.c
index edce885..5660368 100644
--- a/daemon/gvfsbackendcdda.c
+++ b/daemon/gvfsbackendcdda.c
@@ -225,6 +225,8 @@ on_uevent (GUdevClient *client, gchar *action, GUdevDevice *device, gpointer use
g_udev_device_get_property_as_int (device, "ID_CDROM_MEDIA") != 1))
{
g_vfs_backend_force_unmount (G_VFS_BACKEND (cdda_backend));
+
+ g_signal_handlers_disconnect_by_func (cdda_backend->gudev_client, on_uevent, cdda_backend);
}
}
@@ -416,7 +418,9 @@ do_unmount (GVfsBackend *backend,
release_device (cdda_backend);
release_metadata (cdda_backend);
-
+
+ g_signal_handlers_disconnect_by_func (cdda_backend->gudev_client, on_uevent, cdda_backend);
+
g_vfs_job_succeeded (G_VFS_JOB (job));
//g_warning ("unmounted %p", backend);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]