Just don't create it on heap. QPixmap is implicitly shared.
It does not matter how you create pixmap. What does is total number of allocated resources.
Changes to your code might fix something if your previous code did not clean the memory -did not delete pixmap.
So code causing problem was not posted.