Details
-
Bug
-
Resolution: Done
-
P1: Critical
-
5.11.1
-
None
-
Windows 10 64-bit MSVC 2017
-
-
3314694004b825263c9b9f2d69bd85da806ccbbc (qt/qt3d/5.11)
Description
I wish to use multiple Qt3D views in my application. Using multiple Qt3DWindows and then deleting one results in a crash roughly 50 % of the time. I am able to reproduce the crash with the code below (again, roughly 50 % of the time):
#include <QApplication> #include <qboxlayout.h> #include <qt3dwindow.h> #include <QDialog> #include <QTimer> int main(int argc, char *argv[]) { QApplication a(argc, argv); QDialog dialog; dialog.resize(640,480); Qt3DExtras::Qt3DWindow* view = new Qt3DExtras::Qt3DWindow; QWidget* container = QWidget::createWindowContainer(view); Qt3DExtras::Qt3DWindow* view2 = new Qt3DExtras::Qt3DWindow; QWidget* container2 = QWidget::createWindowContainer(view2); QVBoxLayout* layout = new QVBoxLayout; layout->addWidget(container); layout->addWidget(container2); dialog.setLayout(layout); dialog.show(); QTimer::singleShot(500, container2, &QObject::deleteLater); return a.exec(); }
The trace looks as follows:
1 QVector<Qt3DRender::Render::StateVariant>::~QVector<Qt3DRender::Render::StateVariant> qvector.h 73 0x7ff884509a4e
2 Qt3DRender::Render::RenderStateSet::~RenderStateSet renderstateset.cpp 63 0x7ff88451058a
3 Qt3DRender::Render::RenderStateSet::`scalar deleting destructor' Qt53DRenderd 0x7ff884481b77
4 Qt3DRender::Render::RenderView::~RenderView renderview.cpp 269 0x7ff884494ea1
5 Qt3DRender::Render::RenderView::`scalar deleting destructor' Qt53DRenderd 0x7ff884481bc7
6 qDeleteAll<Qt3DRender::Render::RenderView * __ptr64 const * __ptr64> qalgorithms.h 320 0x7ff88447bab8
7 qDeleteAll<QVector<Qt3DRender::Render::RenderView * __ptr64>> qalgorithms.h 329 0x7ff88447bb32
8 Qt3DRender::Render::Renderer::doRender renderer.cpp 734 0x7ff88446e394
9 Qt3DRender::Render::Renderer::render renderer.cpp 612 0x7ff88446df52
10 Qt3DRender::Render::RenderThread::run renderthread.cpp 87 0x7ff8841830b0
11 QThreadPrivate::start qthread_win.cpp 380 0x7ff8827271da
12 BaseThreadInitThunk KERNEL32 0x7ff8dcd73034
13 RtlUserThreadStart ntdll 0x7ff8df481431
Is achieving multiple Qt3D views (e.g. a temporary pop-up window) intended to be done some other way rather than spawning multiple Qt3DWindows?