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

Unloading Camera (QML) item on Android hangs app.

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P1: Critical
    • None
    • 6.4.1
    • Multimedia
    • None
    • Android 11.
    • Android
    • d4e02d9ef (dev), 82e3110e2 (6.5), 207960523 (6.4)

    Description

      On Android the camera permission is requested the moment a Camera QML instance is instantiated.
      As a result it makes sense to place it in a Loader to only ask permission when the user navigates to the part that needs a camera.

      When the camera is no longer needed, I unload the Camera (set myloader.active to false).
      The rationale here is that the next time the camera is needed, I will need to ask the OS again if the app has permission to do so. The user might have changed the permissions in the mean time.

      On desktop this works. On Android the unloading of the Camera object has an odd side-effect. It completely hangs the application (well, the GUI thread anyway).
      I need to explicitly close the application completely in order to be able to restart and get any interaction going again.

      I attach a simple test app I've used to figure out what is going on.
      The workflow that I expect to work is;

      a. create video pane.

      b. turn on camera.

      c. turn off camera.

      d. Remove it.

      On 'd' the app hangs.

      Attachments

        1. camExample.qml
          1 kB
          Tom Zander
        2. QTBUG109168.tar.bz2
          14.12 MB
          Tom Zander

        Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

              samuelmira Samuel Mira
              tomz Tom Zander
              Votes:
              3 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes