Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-56172

ActiveQt components are not well behaved when unloading/reloading

    XMLWordPrintable

    Details

      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

        1. qtbug56172_diag.diff
          5 kB
        2. qtbug56172_stack.txt
          26 kB
        3. simpleqmlapp.zip
          5 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

            • Assignee:
              kleint Friedemann Kleint
              Reporter:
              jornb Jørn Bersvendsen
            • Votes:
              2 Vote for this issue
              Watchers:
              12 Start watching this issue

              Dates

              • Created:
                Updated:

                Gerrit Reviews