【发布时间】:2011-12-17 07:35:11
【问题描述】:
美好的一天!
对于 Qt 4.7.3,下面的示例在 QGraphicsScene::~QGraphicsScene() 调用时崩溃:
#include <QCoreApplication>
#include <QGraphicsScene>
int main( int argc, char* argv[] )
{
// replace this with QObject app; and no problems
QCoreApplication app( argc, argv );
new QGraphicsScene( &app );
return 0;
}
有什么想法吗?
更新:
Bug report 已创建。
【问题讨论】:
-
这是您的实际代码吗?
new QGraphicsScene( &app );应该做什么? -
是的,这是经过多次简化后的实际代码。此行在堆中创建未命名对象。我没有任何其他文件并使用 qmake 构建应用程序。
-
是的,当 'app' 离开范围时,它会删除子对象 - QGraphicsScene 实例。
标签: qt segmentation-fault qgraphicsscene