Import 2017-06-07 23:51:09: master bb03b4d2

Author Committer Branch Timestamp Parent
lassoan lassoan master 2015-12-23 16:07:30 master 2c0de2fd
Changeset

ENH: Use weak pointer to store pointer to scene in nodes to avoid crashes

Nodes stored a simple pointer to the scene, therefore when the scene was deleted the node had a dangling pointer (pointer pointing to an invalid memory area), which caused crashes in certain use cases.

Fix: Use weak pointer to store pointer to scene. When the scene is deleted the weak pointer is set to NULL, and a NULL-pointer check is always done before accessing the scene pointer.

git-svn-id: http://svn.slicer.org/Slicer4/trunk@24824 3bd1e089-480b-0410-8dfb-8563597acbee

mod - Libs/MRML/Core/vtkMRMLNode.cxx Diff File
mod - Libs/MRML/Core/vtkMRMLNode.h Diff File