Uploaded image for project: 'Qt Creator'
  1. Qt Creator
  2. QTCREATORBUG-11395

Not expected calls to IEditor::duplicate(), may burden the memory significantly

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P1: Critical
    • Resolution: Done
    • Affects Version/s: Qt Creator 3.0.0
    • Fix Version/s: Qt Creator 3.1.0-beta
    • Component/s: Editors
    • Labels:
      None
    • Commits:
      783d6ebbd2f62d63d1824f8727e3ae9729443ef8

      Description

      Apply the following patch:

      https://codereview.qt-project.org/#change,77046

      Do the following:
      1) Don't open any project
      2) Open two cpp files, let's say: a.cpp and b.cpp. You should notice 2 debug lines about creating CppEditor. (Later in text I mark such a line with: "Create")
      3) Split the editor - new debug line: "Create".
      4) In the bottom split, change the current editor (with combobox) to a.cpp. No debug line.
      5) In the top split change the current editor to:
      5a) a.cpp. A new debug line: "Create"
      5b) b.cpp. No new debug line.

      Until now the behaviour was expected.

      5c) a.cpp. A new debug line: "Create". Why duplicate editor is called now? (looks like a buggy behaviour)
      5d) b.cpp. No new debug line.
      5e) a.cpp. Again, a new debug line: "Create" (bug?). When I repeat 5d and 5e I always see, that a new editor is being created on 5e.

      6) Close the top split. I get several debug lines about destructor (the number of these lines is the same as number of "Create" lines minus 2 (for the 2 editors in the bottom split)). Everything is properly destroyed, but it proves, that I could have even 100 editors created for only 4 available (2 in top split, 2 in bottom split), depending on switching in top combobox.

        Attachments

        For Gerrit Dashboard: QTCREATORBUG-11395
        # Subject Branch Project Status CR V

          Activity

            People

            Assignee:
            con Eike Ziller
            Reporter:
            jkobus Jarek Kobus
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Gerrit Reviews

                There are no open Gerrit changes