Details
-
Bug
-
Resolution: Invalid
-
P4: Low
-
None
-
5.10.1
-
None
-
macOS 10.13.4
Qt 5.10.1 (installed via Homebrew)
Compiler Apple LLVM version 9.1.0 (clang-902.0.39.1)
Description
It appears that failing to destroy a QNetworkAccessManager may result in a process crash.
How to reproduce
1. Compile this C++ program
#include <QCoreApplication> #include <QNetworkAccessManager> int main( int argc, char **argv ) { QCoreApplication app( argc, argv ); (void) new QNetworkAccessManager(); }
2. Execute the program in an infinite loop, e.g. via
$ while ./main; do; done
Expected Behaviour
The loop never terminates, the program always returns with exit code 0.
Observed Behaviour
The loop eventually (sometimes sooner, sometimes later) terminates since the program crashes. In some cases, the message 'Pure virtual function called!' is printed, in other cases no such message is printed.
The issue can be worked around by ensuring that the QNetworkAccessManager is destroyed, e.g. by allocating the instance on the stack or delete'ing a dynamically allocated instance.