MCPcopy Create free account
hub / github.com/Kitware/VTK / remove

Method remove

Wrapping/PythonCore/vtkPythonUtil.cxx:106–125  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

104}
105
106void vtkPythonObjectMap::remove(vtkObjectBase* key)
107{
108 iterator i = this->find(key);
109 if (i != this->end())
110 {
111 // Save the object. The iterator will become invalid if the iterator is
112 // erased.
113 vtkObjectBase* obj = i->first;
114 // Remove it from the map if necessary.
115 if (!--i->second.second)
116 {
117 this->erase(i);
118 }
119 // Remove a reference to the object. This must be done *after* removing it
120 // from the map (if needed) because if there's a callback which reacts when
121 // the reference is dropped, it might call RemoveObjectFromMap as well. If
122 // it still exists in the map at that point, this becomes an infinite loop.
123 obj->Delete();
124 }
125}
126
127// Keep weak pointers to VTK objects that python no longer has
128// references to. Python keeps the python 'dict' for VTK objects

Callers 15

DoFilesExistFunction · 0.45
SaveOpenVDBFile.pyFile · 0.45
TestCellArray.pyFile · 0.45
TestEmptyXML.pyFile · 0.45

Calls 4

DeleteMethod · 0.65
findMethod · 0.45
endMethod · 0.45
eraseMethod · 0.45

Tested by 9

TestFailingNodeFunction · 0.36
ValidateFieldDataFunction · 0.36
testMethod · 0.36
testMethod · 0.36
TestDataTypeFunction · 0.36
testMethod · 0.36
testMethod · 0.36
mainFunction · 0.36
testCopyStructureMethod · 0.36