[gvfs] recent: Prevent crash when recent file changed
- From: Ondrej Holy <oholy src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gvfs] recent: Prevent crash when recent file changed
- Date: Fri, 15 Dec 2017 08:51:35 +0000 (UTC)
commit 761f226a13b5d46b2f010c8e1c2723f675184be8
Author: Ondrej Holy <oholy redhat com>
Date: Thu Dec 14 10:07:01 2017 +0100
recent: Prevent crash when recent file changed
If recent file is changed and directory monitor doesn't exists,
the recent backend crashes. Check the monitor first before emitting
event in order to prevent this crashes.
daemon/gvfsbackendrecent.c | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
---
diff --git a/daemon/gvfsbackendrecent.c b/daemon/gvfsbackendrecent.c
index 2947600..a1803f3 100644
--- a/daemon/gvfsbackendrecent.c
+++ b/daemon/gvfsbackendrecent.c
@@ -561,9 +561,10 @@ reload_recent_items (GVfsBackendRecent *backend)
g_list_free (added);
/* process changes */
- for (l = changed; l; l = l->next)
+ if (monitor)
{
- g_vfs_monitor_emit_event (monitor, G_FILE_MONITOR_EVENT_ATTRIBUTE_CHANGED, l->data, NULL);
+ for (l = changed; l; l = l->next)
+ g_vfs_monitor_emit_event (monitor, G_FILE_MONITOR_EVENT_ATTRIBUTE_CHANGED, l->data, NULL);
}
g_list_free (changed);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]