QString destructor crash
Solved
General and Desktop
-
I am new to Qt, and immediately I am experiencing the strange issue that simply calling the QString destructor will crash my program. Here is the most minimal example:
#include <iostream> #include <QString> int main(int argc, char *argv[]) { std::cout << "before" << std::endl; QString* str = new QString("hallo"); delete str; std::cout << "after" << std::endl; return 0; }
The second print statement is never reached. Appearently the issue lies more specifically with the detructor of QArrayDataPointer. The call stack looks like this:
I am using Qt 6.8.2 on Windows.
I'm at a loss here. Is something wrong with my installation? Thanks in advance for your help -
Don't mix debug and release libraries. You most likely compile your app in debug mode but link against release Qt dlls.
-
Pardon me, but how do I make sure to compile in release? If I set CMAKE_BUILD_TYPE to Release, the issue stays the same
-