[GTK] Workaround crash on Windows with ico or gif icons

A problem with GdkPixbuf loaders on Windows causes a hard crash when
attempting to load ico or gif tracker icons.

Added a workaround by skipping these icon types until a more permanent
solution is found.

Ref: https://dev.deluge-torrent.org/ticket/3501
This commit is contained in:
Calum Lind 2022-02-08 19:46:59 +00:00
parent 24a3987c3a
commit 90744dc2e6
No known key found for this signature in database
GPG Key ID: 90597A687B836BA3

View File

@ -70,6 +70,11 @@ def get_pixbuf(filename: str, size: int = 0) -> Pixbuf:
A newly created pixbuf
"""
# Skip ico and gif that cause Pixbuf crash on Windows
# https://dev.deluge-torrent.org/ticket/3501
if windows_check() and filename.endswith(('.ico', '.gif')):
return create_blank_pixbuf(size)
if not os.path.isabs(filename):
filename = get_pixmap(filename)