Skip to content

file-operations: Limit use of NautilusFile's in threads

Corey Berla requested to merge wip/corey/copy-crash into main

NautilusFile/NautilusDirectory is not threadsafe. Nautilus crashes when rapid fire copying files due to a regression in [1] which calls nautilus_file_get() in a thread. When nautilus_file_get() is called before the file exists in a NautilusDirectory, it attempts to create the file, but that same file may already be in the process of being created in another thread. Since the use of the NautilusFile was simply to check if the file is a directory, use the existing is_dir() function (which in turn calls g_file_query_file_type()) instead. The performance differential is negligible (if any), and is not even called from the main thread.

[1] 2b2031d4

Fixes: #2469 (closed)

Merge request reports