Prevent leaking ThunarFiles when closing thunar while thumbnailing is in process
Version information
Thunar 4.21.1
Steps to reproduce
- Build thunar with
meson setup --reconfigure build --buildtype=debug - Stop thunar
thunar -q - Backup changed thumbnails
mv ~/.cache/thumbnails ~/.cache/thumbnails.backup - Enable thumbnailing in thunar
- Open a folder with many pictures (I tested with 400)
- Scroll down quickly, so that a thumbnail request for all pictures in the folder will be sent
- Quickly close thunar before thumnailing finished
Current behavior
- Message:
--- Leaked a total of 210 ThunarFile objects: ....
Expected outcome
No ThunarFiles should be leaked
Additional information
The thumbnailing code was drastically changed in !416 (merged). Now every ThunarFile is holding a ThunarThumbnailer reference which is released when the file is finalized. However, the file cannot be finalized while its thumbnail request is not finished yet. The current code simply does not cancel thumbnail jobs on exit.
No fix, but some code changes: code.diff
Edited by Alexander Schwinn