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

2 issues with the clangrefactoring plugin

    XMLWordPrintable

Details

    • Linux/X11, macOS

    Description

      I've run into 2 issues with the clang refactoring plugin in the latest 4.9.82 version that still builds against Qt 5.9 and clang 6 . I don't see any modifications in the current source but since I cannot verify I will file this as a "suggestion" issue.

       

      • The clang reformatting plugin doesn't catch any exceptions from the SQlite C++ wrapper you use. On my Mac it gets one because of a missing table, in `ClangRefactoringPlugin::initialize()`, which aborts the IDE after I activate the plugin. A simple try/catch around the entire function payload and that returns false from the catch fixes that.
      • Activating the same plugin on my Linux system causes a crash on exit because of a hoverhandler race condition in the texteditor plugin. Somehow loading the plugin modifies the order in which instances are deleted on exit. The result is that there is one `BaseHoverHandler` instance that gets deleted before the corresponding `TextEditorWidgetPrivate` instance is deleted, which in turns leads to `BaseHoverHandler::abort()` being called on a stale instance. The workaround I found for that is to catch `QCoreApplication::aboutToQuit` in the `TextEditorWidgetPrivate` ctor, triggering a lambda that calls `m_hoverHandlerRunner.abortHandlers()` proactively and then clears the `m_hoverHandlers` list. I think this should be fine, whatever those handlers do shouldn't be useful anymore when the app is exitting.

      I have patches but IIRC you cannot use them if I upload them here, and I don't want to go through gerrit with modifications to code I cannot test myself.

      Attachments

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

        Activity

          People

            Unassigned Unassigned
            rjvbertin René Bertin
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes