#2406 delete plot crash. Guard pointer to view

This commit is contained in:
Bjørn Erik Jensen 2018-01-25 14:53:51 +01:00
parent 64731fb242
commit 3a1c6406ff
2 changed files with 3 additions and 2 deletions

View File

@ -422,7 +422,7 @@ void RiuMainPlotWindow::addToTemporaryWidgets(QWidget* widget)
//--------------------------------------------------------------------------------------------------
void RiuMainPlotWindow::updateSummaryPlotToolBar()
{
RimSummaryPlot* summaryPlot = dynamic_cast<RimSummaryPlot*>(m_activePlotViewWindow);
RimSummaryPlot* summaryPlot = dynamic_cast<RimSummaryPlot*>(m_activePlotViewWindow.p());
if (summaryPlot)
{
std::vector<caf::PdmFieldHandle*> toolBarFields;

View File

@ -21,6 +21,7 @@
#include "RiuMainWindowBase.h"
#include "cafPdmUiDragDropInterface.h"
#include "cafPdmPointer.h"
#include <QMdiArea>
@ -116,7 +117,7 @@ private:
QByteArray m_initialDockAndToolbarLayout; // Initial dock window and toolbar layout, used to reset GUI
QMdiArea* m_mdiArea;
RimViewWindow* m_activePlotViewWindow;
caf::PdmPointer<RimViewWindow> m_activePlotViewWindow;
QMenu* m_windowMenu;