When using the qtpng driver in a program that already uses Qt, the call to initQtApp() does not create a QApplication object (as one already exists). However, when closeQtApp() is called, it will nevertheless try to delete the global QApplication object. It also tries to delete[] argc/argv, which fails because they were never initialized.
Patch attached.