Details
-
Bug
-
Resolution: Fixed
-
P4: Low
-
5.7.0, 5.8.0 Alpha
-
c903b4948 (dev), 548f9e1bb (6.5), 8809f93a0 (6.6)
Description
ActiveQt components are not well-behaved when unloading/reloading the component DLL.
Static changes made in one ActiveQt app live past the unloading of the DLL and can cause crashes when loading a new ActiveQt app. Such changes include, but are possibly not limited to:
- Registered meta types
- Registered QML types
- Loaded QRC files
Such a crash can easily be reproduced:
- Run ActuveQt testcon project
- Load the simpleqmlax example project
- Close the simpleqmlax control
- Load the simpleqmlax example project again
- Observe crash
Attached is another example project simpleqmlapp. Both simpleqmlapp and simpleqmlax load a QML file from qrc:/main.qml, and they both register a type Controller through qmlRegisterType. The following unwanted behaviour is observed.
- Run ActuveQt testcon project
- Load the simpleqmlax example project
- Load the attached simpleqmlapp example project
- The new control tries to load simpleqmlax's main.qml
- The new control tries to load simpleqmlax's Controller
Also,
- Run ActuveQt testcon project
- Load the simpleqmlax example project
- Close the simpleqmlax control
- Load the attached simpleqmlapp example project
- Observe crash
Furthermore, if the ActiveQt control is loaded when there is no running QApplication, the ActiveQt control will create one first - otherwise it will hook up to an existing application. However, the deletion of the QApplication in the ActiveQt DLL is flawed.
- It does not run the deferred deletion which QCoreApplication::exec normally does.
- It does not care if another ActiveQt component has been loaded in the mean time, meaning that it can kill an unsuspecting component.
Attachments
Issue Links
- relates to
-
QTBUG-114924 Investigate potential crash when unloading dlls that use Qt Quick
-
- Reported
-