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

Destructing QApplication causes warning due to static finalizer order

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P3: Somewhat important
    • 4.8.0
    • 4.4.0
    • SQL Support
    • 0c9866d6b23062bc08e739b66f41de200b660df4

    Description

      When QApplication destructs it deletes any Q_GLOBAL_STATIC objects. This happens in an arbitrary order which is a problem because the SQL code uses one of these destructors to close all open databases and code in Qtopia also uses these destructors to release its databases and queries.

      As a result, we get this:
      QSqlDatabasePrivate::removeDatabase: connection 'qt_sql_default_connection' is still in use, all queries will cease to work.

      To prevent this madness, the warning should be suppressed when QApplication is destructing (there's a flag that's set). If you're trying to use a Query after QApplication has started destructing... well you're screwed anyway so the warning won't help.

      Attachments

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

        Activity

          People

            charles Charles Yin (closed Nokia identity) (Inactive)
            lramsay Lincoln Ramsay (closed Nokia identity) (Inactive)
            Votes:
            2 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes