Skip to content

Commit 6da6ac7

Browse files
committed
Detach QPixmap instance before returning
1 parent 9a4b3e0 commit 6da6ac7

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/PIL/ImageQt.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,4 +213,6 @@ def toqimage(im: Image.Image | str | QByteArray) -> ImageQt:
213213

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

0 commit comments

Comments
 (0)