Ticket #184 (closed: fixed)
Python garbage collection can delete objects from Mantid (bad!)
Reported by: | Matt Clarke | Owned by: | |
---|---|---|---|
Priority: | major | Milestone: | Iteration 11 |
Component: | Keywords: | ||
Cc: | Blocked By: | ||
Blocking: | Tester: |
Description
Some objects returned to Python from Mantid are now owned by Python, so if Python garbage collects them then Mantid can be holding pointers to junk.
Short term fix: Let python refer to the existing objects without taking ownership. This will make Mantid "safe", but does present problems in python if Mantid deletes one of its objects and python holds a pointer to that object.
Possible long term fix: try to give Python smart pointers pointing to Mantid objects. If the object is "deleted" by Mantid, it is not really deleted as python still has a reference. Potentially this could cause problems regarding memory use.
Change History
Note: See
TracTickets for help on using
tickets.
(In [1238]) Changed pythonWrapper so that any object it returns to python are still owned by mantid. This means if you have a workspace object in python and then delete it in Mantid, then the python object points at unallocated memory and will abort if used. Refs #184