Import 2017-06-07 23:51:09: master 17b511d0

Author Committer Branch Timestamp Parent
jcfr jcfr master 2016-08-15 14:03:31 master 4b6ccfe9
Changeset

BUG: Fixed node reference counting tests

MRMLCreateNodeByClassWithSetReferenceCountToOne: removed. This test performs a double-delete and expects to get a runtime error. However, result of double-delete is "undefined behavior", i.e., it is not guaranteed to generate run-time error (and in some cases it does not).

MRMLCreateNodeByClassWithSetReferenceCountMinusOne: comments clarified.

  1. Decreasing the reference count is needed because Python variable takes ownership of the created object, so the additional reference that Create...() adds is not needed anymore.
  2. To decrement reference count, UnRegister() or Delete() method has to be called (SetReferenceCount should never be called).

From: Andras Lasso <lasso@queensu.ca>

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

mod - Applications/SlicerApp/Testing/Python/CMakeLists.txt Diff File
mod - Applications/SlicerApp/Testing/Python/MRMLCreateNodeByClassWithSetReferenceCountMinusOne.py Diff File
rm - Applications/SlicerApp/Testing/Python/MRMLCreateNodeByClassWithSetReferenceCountToOne.py Diff File
mod - Applications/SlicerApp/Testing/Python/MRMLCreateNodeByClassWithoutSetReferenceCount.py Diff File