Crash when quitting app (cause by create C++ object in QML)
-
Hi all, i am creating a QT app which displaying Google Maps via WebEngine. To improve performance and enable debugging, i link the release library of QT with debug mode like this.
CMakeLists.txt
find_package(Qt6 COMPONENTS Gui Qml Quick webenginequick) set_target_properties( Qt6::Qml Qt6::Core Qt6::Gui Qt6::WebEngineQuick PROPERTIES MAP_IMPORTED_CONFIG_DEBUG Release)
I created a C++ object in QML side like this, and the crash always occurs when i quitting the app.
main.qml
Window { width: 640 height: 480 visible: true title: qsTr("Hello World") Rectangle{ x: 20 y: 20 width: 20 height: 20 color: "red" //TestClass is a very simple C++ class derived from QObject TestClass{ } } }
When I tried debugging, I found that an error occurred when destroying a QML element
The crash only occurs when I link the release library with debug mode. If the library version and build mode are the same (both debug or both release), this will not happen. Can anyone explain to me ??? Thank you so much ! -
You must not mix debug and release libs on windows with MSVC as they are using different MSVC runtimes.
-
@Christian-Ehrlicher said in Crash when quitting app (cause by create C++ object in QML):
You must not mix debug and release libs on windows with MSVC as they are using different MSVC runtimes.
The speed of displaying Google Maps on WebEngine in Debug mode is very slow, so I use WebEngine's release library and build in debug mode to serve debugging. Is there a better solution to improve the speed of WebEngine in debug mode?
-
@Huy-Nguyen No, I think you are stuck with the speed if you wish to use the Debug build.