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

Opening QSqlDatabase in parallel causes endless loop at shutdown

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3: Somewhat important P3: Somewhat important
    • 6.5.3, 6.6.0
    • 5.15, 6.5.0
    • SQL Support
    • None
    • All
    • 048a68c1e (dev), 8d2bdc9cd (6.5)

      How to reproduce:

      • Open two QSqlDatabase in separate threads in parallel.

      What happens:

      • On shutdown when QApplication is freed, there is an endless loop.

      I found following cause:

      • When two SQL connections are created in parallel, QSqlDatabasePrivate::driverDict() is called twice in parallel. This will call qAddPostRoutine(cleanDriverDict); twice and cleanDriverDict will appear twice in the PostRoutines.
      • During shutdown, the second cleanDriverDict calls driverDict() again, which reinitializes qDriverDictInit and adds another qAddPostRoutine. So the cleanDriverDict will be called and added again and again.

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

            chehrlic Christian Ehrlicher
            frichter Florian Richter
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes