D12527: Revert R33:e88da8274468 in TextDocument to fix event handler issues

Friedrich W. H. Kossebau noreply at phabricator.kde.org
Thu Jul 5 17:12:55 BST 2018


kossebau added inline comments.

INLINE COMMENTS

> ktexteditorpluginintegration.cpp:350
>      auto viewBar = m_viewBars.take(view);
> -    if (viewBar == m_viewBarContainerLayout->currentWidget()) {
> -        m_mainWindow->viewBarContainer()->hide();
> +    if (m_mainWindow->viewBarContainer()) {
> +        if (viewBar == m_viewBarContainerLayout->currentWidget()) {

Given the viewBarContainer widget is a child of the KDevelop::MainWindow object m_mainWindow and only destructed once that m_mainWindow is destructed, this check seems fragile.
And actually the this class here, KTextEditorIntegration::MainWindow is a child object of m_mainWindow as well, given that one is set as parent to this object, so both objects should be deleted at the same time, in some unspecified order (seems that child widgets are destroyed earlier than other child objects).

Though given that the actual KTextEditor::View objecst are only deleted with deleteLater(), but the KTextEditor::MainWindow object passed to them should be "valid for the complete lifetime of the view", it seems this needs some bigger changes: once to delay the deletion of this object with deleteLater as well and prepare for the actual-mainwindow-already-deleted state. Will see to prepare some patch for this, as I have a debuggin-enriched build already here (needed to find out what I just wrote ;) )

> textdocument.cpp:546
>  
> -bool TextDocument::close(DocumentSaveMode mode)
> -{

From what I saw so far would agree this seems no longer needed and just a duplication.

REPOSITORY
  R32 KDevelop

REVISION DETAIL
  https://phabricator.kde.org/D12527

To: croick, #kdevelop
Cc: kossebau, kdevelop-devel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kdevelop-devel/attachments/20180705/fd1c588f/attachment.html>


More information about the KDevelop-devel mailing list