Skip to content

nautilus-progress-indicator: Disconnect signals from cancelled operations

Gary Li requested to merge li-gary/nautilus:cancel_archive_crash into master

Nautilus currently crashes if the user cancels an archive operation and closes the window. I was able to find shorter repro steps than #1965 (closed), since Nautilus would crash in the background after closing the window, without opening a new window. Either repro steps trigger the same issue.

When the user cancels an archive operation, upon "completion" we execute idle_callback, which will emit a "finished" signal, calling on_progress_info_finished. If the user has closed the window, then we would have finalized the NautilusProgressIndicators, so executing on_progress_info_finished would result in a crash.

disconnect_progress_infos does not currently disconnect all signals related to *self. When the user has waited for more than 3 seconds after cancelling, allowing on_remove_finished_operations_timeout to fire, then this function would have removed the cancelled NautilusProgressInfo, without disconnecting its signals. This results in later disconnect_progress_infos not being able to disconnect cancelled operation signals since it has been removed from NautilusProgressInfoManager's progress_infos linked list.

To fix this, disconnect_progress_infos should disconnect, by data, all signals that have *self. Even if the cancelled operations have been removed from the manager's progress_infos, they are still present in an indicator's progress_infos_model. We use these to disconnect leftover signals to stop on_progress_info_finished from being called with already finalized indicators.

Fixes #1965 (closed)

Edited by Gary Li

Merge request reports