Skip to content

Commit

Permalink
Detach QPixmap instance before returning
Browse files Browse the repository at this point in the history
  • Loading branch information
radarhere committed Oct 28, 2024
1 parent 9a4b3e0 commit 0f93721
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
6 changes: 6 additions & 0 deletions .github/workflows/test-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,12 @@ jobs:
pytest-cov
pytest-timeout
- name: Install CPython dependencies
if: "!contains(matrix.python-version, 'pypy')"
run: >
python3 -m pip install
PyQt6
- name: Install dependencies
id: install
run: |
Expand Down
4 changes: 3 additions & 1 deletion src/PIL/ImageQt.py
Original file line number Diff line number Diff line change
Expand Up @@ -213,4 +213,6 @@ def toqimage(im: Image.Image | str | QByteArray) -> ImageQt:

def toqpixmap(im: Image.Image | str | QByteArray) -> QPixmap:
qimage = toqimage(im)
return getattr(QPixmap, "fromImage")(qimage)
pixmap = getattr(QPixmap, "fromImage")(qimage)
pixmap.detach()
return pixmap

0 comments on commit 0f93721

Please sign in to comment.