forked from qt-creator/qt-creator
QmlDesigner: create DesignerSupport on stack
- it has the same life cycle like the Qt5NodeInstanceServer - we don't need to create and delete it (with maybe memory leaks) - this fixes a crash while the puppet is closed after an item deletion Change-Id: Iecd6515eb41324b95e99e151d77ee74895230182 Reviewed-by: Thomas Hartmann <Thomas.Hartmann@digia.com>
This commit is contained in:
@@ -42,8 +42,7 @@
|
||||
namespace QmlDesigner {
|
||||
|
||||
Qt5NodeInstanceServer::Qt5NodeInstanceServer(NodeInstanceClientInterface *nodeInstanceClient)
|
||||
: NodeInstanceServer(nodeInstanceClient),
|
||||
m_designerSupport(new DesignerSupport)
|
||||
: NodeInstanceServer(nodeInstanceClient)
|
||||
{
|
||||
DesignerSupport::activateDesignerMode();
|
||||
}
|
||||
@@ -51,8 +50,6 @@ Qt5NodeInstanceServer::Qt5NodeInstanceServer(NodeInstanceClientInterface *nodeIn
|
||||
Qt5NodeInstanceServer::~Qt5NodeInstanceServer()
|
||||
{
|
||||
delete quickView();
|
||||
delete m_designerSupport;
|
||||
m_designerSupport = 0;
|
||||
}
|
||||
|
||||
QQuickView *Qt5NodeInstanceServer::quickView() const
|
||||
@@ -128,21 +125,18 @@ void Qt5NodeInstanceServer::refreshBindings()
|
||||
DesignerSupport::refreshExpressions(context());
|
||||
}
|
||||
|
||||
DesignerSupport *Qt5NodeInstanceServer::designerSupport() const
|
||||
DesignerSupport *Qt5NodeInstanceServer::designerSupport()
|
||||
{
|
||||
return m_designerSupport;
|
||||
return &m_designerSupport;
|
||||
}
|
||||
|
||||
void Qt5NodeInstanceServer::createScene(const CreateSceneCommand &command)
|
||||
{
|
||||
m_designerSupport = new DesignerSupport;
|
||||
NodeInstanceServer::createScene(command);
|
||||
}
|
||||
|
||||
void Qt5NodeInstanceServer::clearScene(const ClearSceneCommand &command)
|
||||
{
|
||||
delete m_designerSupport;
|
||||
m_designerSupport = 0;
|
||||
NodeInstanceServer::clearScene(command);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user