From: isn Date: Thu, 18 Apr 2019 11:14:04 +0000 (+0300) Subject: refs #1963 X-Git-Tag: SH_V2_2_0~99^2~23 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=4256b93851e91f50f749c368dde329332f22825f;p=modules%2Fhydro.git refs #1963 --- 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;