I have a program that basically shows a bunch of thumbnails in a scroll view (the type of scroll view doesn't matter since I've seen the same behavior in a QGraphicsView and a subclassed QAbstractScrollArea)

The thumbnails are loaded via several background threads using QImage. When the image is loaded/scaled a signal like so is emitted:

SIGNAL(imageLoaded(QString, QImage))

Where the string is the path to the source file and the QImage is a scaled version of the source. Once I get the image back in the main thread I call QPixmap.fromImage(image) to get a pixmap and display it.

From my understanding QPixmap uses shared data with the window manager (in my case its X11) so when I close my application I see that the memory isn't properly cleaned up.

Is there something I'm doing wrong? Do I need to cleanup the shared data somehow? Or is this an X bug?

(FYI, full disclosure I'm using PyQt not that it should matter)