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

QMacToolbar crashes on application exit when using on windows with Qt::WA_DeleteOnClose

    XMLWordPrintable

Details

    • Bug
    • Resolution: Cannot Reproduce
    • P2: Important
    • None
    • 5.3.0
    • Extras: Mac
    • None
    • Mac OS X 10.9.3, Qt Creator 3.1.1

    Description

      The new QMacToolbar crashes on application exit when using on windows with Qt::WA_DeleteOnClose set to true.

      This is reproducible by creating a new Qt GUI Project with a main window and copying the following code into its constructor (which has been taken (and corrected!)) from the QMacToolBar documentation (which is not included in the release!):

      MainWindow.cpp
          QMacToolBar *toolBar = new QMacToolBar(this);
          QMacToolBarItem *toolBarItem = toolBar->addItem(QIcon(), QStringLiteral("foo"));
      
          this->window()->winId(); // create window->windowhandle()
          toolBar->attachToWindow(this->window()->windowHandle());
      
          setAttribute(Qt::WA_DeleteOnClose);
      

      Stacktrace in case it helps:

      0	__pthread_kill	__pthread_kill		0x7fff8e62c866	
      1	pthread_kill	pthread_kill		0x7fff8e4c835c	
      2	abort	abort		0x7fff88a2bb1a	
      3	free	free		0x7fff8ca4707f	
      4	~MainWindow	MainWindow.cpp	23	0x100003719	
      5	QObject::event(QEvent*)	QObject::event(QEvent*)		0x100de4c50	
      6	QWidget::event(QEvent*)	QWidget::event(QEvent*)		0x100070452	
      7	QMainWindow::event(QEvent*)	QMainWindow::event(QEvent*)		0x100165e77	
      8	QApplicationPrivate::notify_helper(QObject*, QEvent*)	QApplicationPrivate::notify_helper(QObject*, QEvent*)		0x100037b1c	
      9	QApplication::notify(QObject*, QEvent*)	QApplication::notify(QObject*, QEvent*)		0x10003a5db	
      10	QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*)	QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*)		0x100db8447	
      11	QCoreApplication::exec()	QCoreApplication::exec()		0x100db7ece	
      12	main	main.cpp	10	0x10000330b	
      

      Attachments

        Activity

          People

            sorvig Morten Sørvig
            kampfgnom Niklas Wulf
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: