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

Android: Close.accepted = false causes freeze on next app start

    XMLWordPrintable

Details

    • Android
    • 2023wk46FOQtforAndroid, 2023wk48FOQtforAndroid, 2023wk50FOQtforAndroid, 2023wk52FOQtforAndroid, 2024wk04FOQtforAndroid, 2024wk10FOQtforAndroid, 2024wk16FOQtforAndroid

    Description

      Window QML documentation recommends using close.accepted = false in a Window that needs to do some work before closing. However, on Android this can cause the following invocations of your app to freeze on the splash screen.

      Reproduction steps:
      1. Use the coffee example app
      2. Add the handler to Main.qml

      onClosing: function(close)
      {
      	close.accepted = false
      }
      

      3. Open and wait for the app to load.
      4. Kill the app via the Android task view (i.e swipe up to open recent apps, then swipe up again on the app) and quickly open it again. You have to open it again quickly, within 0-2 seconds.
      5. Notice the app freezes on the splash screen.
      (Steps 3-4 may need to be repeated 3-5 times in order to get a reproduction)

      Expected results:
      App should not freeze on splash screen, even if setting close.accepted = false.

      Potential cause:
      Qt is not closing properly when this flag is set, maybe a system level resource is not being released properly. Starting again seems to wait on a futex or lock that is never acquired.

      Reproduced on:
      Android 34
      Qt 6.6.0
      Qt 6.5.2

      Likely affects other Android versions as well.

      Attachments

        Issue Links

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

          Activity

            People

              qtandroidteam Qt Android Team
              camgaertner Cameron G
              Votes:
              1 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:

                Gerrit Reviews

                  There are no open Gerrit changes