Page MenuHomePhabricator

0001-Fix-crash-from-DataManager-potential-invalid-pointer.patch

Authored By
morency
Nov 2 2012, 4:11 PM
Size
1 KB
Referenced Files
None
Subscribers
None

0001-Fix-crash-from-DataManager-potential-invalid-pointer.patch

From 99fddb8e28f8633d3d86bcafef93dd3ea3fe24b2 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?"F=C3=A9lix=20C.=20Morency"?= <felix.c.morency@usherbrooke.ca>
Date: Fri, 2 Nov 2012 11:06:16 -0400
Subject: [PATCH] Fix crash from DataManager potential invalid pointer
The application will crash if the DataManager fails to get/open a valid
render window part in GlobalReinit(). This context is possible if a
non-rendering editor is already open and linked to the DataStorage
mapped by the DataManager
---
.../src/QmitkDataManagerView.cpp | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/Plugins/org.mitk.gui.qt.datamanager/src/QmitkDataManagerView.cpp b/Plugins/org.mitk.gui.qt.datamanager/src/QmitkDataManagerView.cpp
index 34c1d47..6619a56 100644
--- a/Plugins/org.mitk.gui.qt.datamanager/src/QmitkDataManagerView.cpp
+++ b/Plugins/org.mitk.gui.qt.datamanager/src/QmitkDataManagerView.cpp
@@ -643,7 +643,7 @@ void QmitkDataManagerView::SaveSelectedNodes( bool )
void QmitkDataManagerView::ReinitSelectedNodes( bool )
{
mitk::IRenderWindowPart* renderWindow = this->GetRenderWindowPart();
-
+
if (renderWindow == NULL)
renderWindow = this->OpenRenderWindowPart(false);
@@ -802,10 +802,15 @@ QItemSelectionModel *QmitkDataManagerView::GetDataNodeSelectionModel() const
void QmitkDataManagerView::GlobalReinit( bool )
{
mitk::IRenderWindowPart* renderWindow = this->GetRenderWindowPart();
-
+
if (renderWindow == NULL)
+ {
renderWindow = this->OpenRenderWindowPart(false);
-
+
+ if(renderWindow == NULL)
+ return;
+ }
+
// get all nodes that have not set "includeInBoundingBox" to false
mitk::NodePredicateNot::Pointer pred
= mitk::NodePredicateNot::New(mitk::NodePredicateProperty::New("includeInBoundingBox"
--
1.7.9.5

File Metadata

Mime Type
text/plain
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
887
Default Alt Text
0001-Fix-crash-from-DataManager-potential-invalid-pointer.patch (1 KB)