mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Janitor: Guard null pointer access
This commit is contained in:
parent
bca2fadc28
commit
9023b01cfa
@ -318,8 +318,11 @@ void RiuMainWindowBase::removeViewerFromMdiArea( QMdiArea* mdiArea, QWidget* vie
|
|||||||
{
|
{
|
||||||
bool wasMaximized = viewer && viewer->isMaximized();
|
bool wasMaximized = viewer && viewer->isMaximized();
|
||||||
|
|
||||||
QMdiSubWindow* subWindowBeingClosed = findMdiSubWindow( viewer );
|
|
||||||
bool removedSubWindowWasActive = false;
|
bool removedSubWindowWasActive = false;
|
||||||
|
|
||||||
|
QMdiSubWindow* subWindowBeingClosed = findMdiSubWindow( viewer );
|
||||||
|
if ( subWindowBeingClosed )
|
||||||
|
{
|
||||||
if ( subWindowBeingClosed->isActiveWindow() )
|
if ( subWindowBeingClosed->isActiveWindow() )
|
||||||
{
|
{
|
||||||
// If we are removing the active window, we will need a new active window
|
// If we are removing the active window, we will need a new active window
|
||||||
@ -334,6 +337,7 @@ void RiuMainWindowBase::removeViewerFromMdiArea( QMdiArea* mdiArea, QWidget* vie
|
|||||||
// https://github.com/OPM/ResInsight/issues/6676
|
// https://github.com/OPM/ResInsight/issues/6676
|
||||||
subWindowBeingClosed->hide();
|
subWindowBeingClosed->hide();
|
||||||
subWindowBeingClosed->deleteLater();
|
subWindowBeingClosed->deleteLater();
|
||||||
|
}
|
||||||
|
|
||||||
QList<QMdiSubWindow*> subWindowList = mdiArea->subWindowList( QMdiArea::ActivationHistoryOrder );
|
QList<QMdiSubWindow*> subWindowList = mdiArea->subWindowList( QMdiArea::ActivationHistoryOrder );
|
||||||
if ( !subWindowList.empty() )
|
if ( !subWindowList.empty() )
|
||||||
|
Loading…
Reference in New Issue
Block a user