The problem goes as follows:
- You put some XC nodes or elements or anything like that in a Python list
node_list= [n1, n2, n3, n4]
- For whatever reason, the node
n3 must be removed from the model, so the C++ counterpart of the n3 Python object is deleted. The n3 Python object and the third item of the node_list list become dangling references.
- Any attempt to access either
n3 or node_list[2] results in a segmentation fault condition and the program crashes.
Maybe there is a way of informing boost.python about the deletion of the C++ objects, so n3 and node_list[2] can return None.
To look into:
The problem goes as follows:
node_list= [n1, n2, n3, n4]n3must be removed from the model, so the C++ counterpart of then3Python object is deleted. Then3Python object and the third item of thenode_listlist become dangling references.n3ornode_list[2]results in a segmentation fault condition and the program crashes.Maybe there is a way of informing boost.python about the deletion of the C++ objects, so
n3andnode_list[2]can returnNone.To look into: