From 4256b93851e91f50f749c368dde329332f22825f Mon Sep 17 00:00:00 2001 From: isn Date: Thu, 18 Apr 2019 14:14:04 +0300 Subject: [PATCH] refs #1963 --- src/HYDROGUI/HYDROGUI_Overview.cxx | 15 ++++++++++----- src/HYDROGUI/HYDROGUI_Overview.h | 1 + 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/src/HYDROGUI/HYDROGUI_Overview.cxx b/src/HYDROGUI/HYDROGUI_Overview.cxx index 163d48df..354e7e23 100644 --- a/src/HYDROGUI/HYDROGUI_Overview.cxx +++ b/src/HYDROGUI/HYDROGUI_Overview.cxx @@ -244,10 +244,7 @@ void HYDROGUI_OverviewBand::paintEvent( QPaintEvent* thePaintEvent ) painter.drawPolygon( myPoints ); } - - - - +////////////// HYDROGUI_Overview::HYDROGUI_Overview( const QString& theTitle, int theMargin, QWidget* theParent ) : QFrame( theParent ), myMargin( theMargin ), @@ -263,6 +260,7 @@ HYDROGUI_Overview::HYDROGUI_Overview( const QString& theTitle, int theMargin, QW HYDROGUI_Overview::~HYDROGUI_Overview() { + //delete myViewPort; } QImage HYDROGUI_Overview::dump() const @@ -335,6 +333,7 @@ void HYDROGUI_Overview::setMainView( OCCViewer_ViewFrame* theMainView ) this, SLOT( OnTransformation() ) ); connect( myMainView, SIGNAL(destroyed()), this, SLOT( onMainViewDestr() ) ); + connect( myViewPort, SIGNAL(destroyed()), this, SLOT( onViewPortDestr() ) ); if( !myViewPort ) { @@ -495,7 +494,13 @@ void HYDROGUI_Overview::onMainViewDestr() return; Handle(V3d_View) ov = myViewPort->getView(); ov->View()->Deactivate(); - delete myViewPort; + delete myViewPort; //this will delete myBand + myViewPort = NULL; + myBand = NULL; +} + +void HYDROGUI_Overview::onViewPortDestr() +{ myViewPort = NULL; } diff --git a/src/HYDROGUI/HYDROGUI_Overview.h b/src/HYDROGUI/HYDROGUI_Overview.h index 36a1a2d7..2745e301 100644 --- a/src/HYDROGUI/HYDROGUI_Overview.h +++ b/src/HYDROGUI/HYDROGUI_Overview.h @@ -58,6 +58,7 @@ private slots: void OnMouseEvent( QMouseEvent* ); void OnResizeEvent( QResizeEvent* ); void onMainViewDestr(); + void onViewPortDestr(); private: QGridLayout* myLayout; -- 2.39.2