In 2D renderer mode, the function createTextureFromImage(const QImage &image) creates one extra instance of QImage and keeps it unreleased.
It creates the issue for us as in our application we use the ability of QImage to create multiple instances of QImage from the same buffer: QImage(uchar *data, int width, int height, Format format, QImageCleanupFunction cleanupFunction = Q_NULLPTR, void *cleanupInfo = Q_NULLPTR) and possibility to count the number of instances by using the cleanup function.
Steps to reproduce:
1. Run the attached code example.
2 Observe the debug output of the application:
the current output for 2D renderer:
As you can see one in 2D renderer mode one extra copy of the the image is created and not released for a long time. I noticed that this image is sometimes is been released spontaneously after several seconds if some CPU idling is added. Reproduced on macOS high Sierra and Windows 10