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

QML TextEdit (and TextArea) crashs after hide window and than show it again

    XMLWordPrintable

Details

    Description

      There is QList<Node*> textNodeMap in QQuickTextEditPrivate ( qtdeclarative\src\quick\items\qquicktextedit.cpp ):
      void QQuickTextEditPrivate::addCurrentTextNodeToRoot(QSGTransformNode *root, QQuickTextNode *node, TextNodeIterator &it, int startPos)
      {
      node->m_engine->addToSceneGraph(node, QQuickText::Normal, QColor());
      it = textNodeMap.insert(it, new TextNode(startPos, node));
      ++it;
      root->appendChildNode(node);
      }
      So, "textNodeMap" contains pointer to "node". But "node" is child of "root". When we hide the window RootNode "root" is destroing with all its children ( QSGWindowsRenderLoop::hide(QQuickWindow *window) ). And we have invalid pointers inside textNodeMap. After destroing RootNode we should probably clear "textNodeMap" ( i.e., in updatePaintNode(...) ):
      if( !oldNode ){
      TextNodeIterator nodeIterator = d->textNodeMap.begin();
      while (nodeIterator != d->textNodeMap.end())

      { delete *nodeIterator; ++nodeIterator; }

      d->textNodeMap.clear();
      }

      Attachments

        1. dev_branch_stack131101.txt
          3 kB
        2. QmlTextEditBug.zip
          1 kB
        3. qtbug34181.zip
          3 kB

        Issue Links

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

          Activity

            People

              aalpert Alan Alpert
              menskliving Oleg
              Votes:
              1 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes