diff options
author | Allison Ryan Lortie <desrt@desrt.ca> | 2015-11-30 10:13:46 -0500 |
---|---|---|
committer | Kalev Lember <klember@redhat.com> | 2016-09-14 16:53:49 +0200 |
commit | c3c7cc6afafa58d40f9fc5e15ce358d33bb01bf0 (patch) | |
tree | 76349c45f39afd0862ab79243c4c0fd20d854418 | |
parent | 382beade0711db9ce0507a382b114be4bb5f3347 (diff) | |
download | glib-2-46.tar.gz |
file monitors: reorder some code to avoid segfaultglib-2-46
We must initialise '->source' before we use fields inside of it.
https://bugzilla.gnome.org/show_bug.cgi?id=758823
-rw-r--r-- | gio/glocalfilemonitor.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/gio/glocalfilemonitor.c b/gio/glocalfilemonitor.c index 62d269c79..cb13bbf96 100644 --- a/gio/glocalfilemonitor.c +++ b/gio/glocalfilemonitor.c @@ -748,6 +748,9 @@ g_local_file_monitor_start (GLocalFileMonitor *local_monitor, g_assert (!local_monitor->source); + source = g_file_monitor_source_new (local_monitor, filename, is_directory, flags); + local_monitor->source = source; /* owns the ref */ + if (is_directory && !class->mount_notify && (flags & G_FILE_MONITOR_WATCH_MOUNTS)) { #ifdef G_OS_WIN32 @@ -771,9 +774,6 @@ g_local_file_monitor_start (GLocalFileMonitor *local_monitor, #endif } - source = g_file_monitor_source_new (local_monitor, filename, is_directory, flags); - local_monitor->source = source; /* owns the ref */ - G_LOCAL_FILE_MONITOR_GET_CLASS (local_monitor)->start (local_monitor, source->dirname, source->basename, source->filename, source); |