mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-06-06 12:50:07 +02:00
file monitors: reorder some code to avoid segfault
We must initialise '->source' before we use fields inside of it. https://bugzilla.gnome.org/show_bug.cgi?id=758823
This commit is contained in:
parent
c2d0c40bff
commit
30359e7409
@ -748,6 +748,9 @@ g_local_file_monitor_start (GLocalFileMonitor *local_monitor,
|
|||||||
|
|
||||||
g_assert (!local_monitor->source);
|
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))
|
if (is_directory && !class->mount_notify && (flags & G_FILE_MONITOR_WATCH_MOUNTS))
|
||||||
{
|
{
|
||||||
#ifdef G_OS_WIN32
|
#ifdef G_OS_WIN32
|
||||||
@ -771,9 +774,6 @@ g_local_file_monitor_start (GLocalFileMonitor *local_monitor,
|
|||||||
#endif
|
#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,
|
G_LOCAL_FILE_MONITOR_GET_CLASS (local_monitor)->start (local_monitor,
|
||||||
source->dirname, source->basename, source->filename,
|
source->dirname, source->basename, source->filename,
|
||||||
source);
|
source);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user