Changeset View
Changeset View
Standalone View
Standalone View
kdevplatform/shell/ktexteditorpluginintegration.cpp
Show First 20 Lines • Show All 341 Lines • ▼ Show 20 Line(s) | 341 | { | |||
---|---|---|---|---|---|
342 | Q_UNUSED(view); | 342 | Q_UNUSED(view); | ||
343 | // we reuse the central view bar for every view | 343 | // we reuse the central view bar for every view | ||
344 | return m_mainWindow->viewBarContainer(); | 344 | return m_mainWindow->viewBarContainer(); | ||
345 | } | 345 | } | ||
346 | 346 | | |||
347 | void MainWindow::deleteViewBar(KTextEditor::View *view) | 347 | void MainWindow::deleteViewBar(KTextEditor::View *view) | ||
348 | { | 348 | { | ||
349 | auto viewBar = m_viewBars.take(view); | 349 | auto viewBar = m_viewBars.take(view); | ||
350 | if (m_mainWindow->viewBarContainer()) { | ||||
kossebau: Given the viewBarContainer widget is a child of the KDevelop::MainWindow object m_mainWindow… | |||||
Patch now up as D13905 kossebau: Patch now up as D13905 | |||||
350 | if (viewBar == m_viewBarContainerLayout->currentWidget()) { | 351 | if (viewBar == m_viewBarContainerLayout->currentWidget()) { | ||
351 | m_mainWindow->viewBarContainer()->hide(); | 352 | m_mainWindow->viewBarContainer()->hide(); | ||
352 | } | 353 | } | ||
353 | delete viewBar; | 354 | delete viewBar; | ||
354 | } | 355 | } | ||
356 | } | ||||
355 | 357 | | |||
356 | void MainWindow::showViewBar(KTextEditor::View *view) | 358 | void MainWindow::showViewBar(KTextEditor::View *view) | ||
357 | { | 359 | { | ||
358 | auto viewBar = m_viewBars.value(view); | 360 | auto viewBar = m_viewBars.value(view); | ||
359 | Q_ASSERT(viewBar); | 361 | Q_ASSERT(viewBar); | ||
360 | m_viewBarContainerLayout->setCurrentWidget(viewBar); | 362 | m_viewBarContainerLayout->setCurrentWidget(viewBar); | ||
361 | viewBar->show(); | 363 | viewBar->show(); | ||
362 | 364 | | |||
▲ Show 20 Lines • Show All 99 Lines • Show Last 20 Lines |
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 ;) )