Opened 9 years ago
Closed 9 years ago
#367 closed defect (fixed)
Error after deleting all atoms
| Reported by: | Tom Goddard | Owned by: | Eric Pettersen |
|---|---|---|---|
| Priority: | major | Milestone: | |
| Component: | Structure Editing | Version: | |
| Keywords: | Cc: | meng@… | |
| Blocked By: | Blocking: | ||
| Notify when closed: | Platform: | all | |
| Project: | ChimeraX |
Description
Deleting all atoms causes the C++ code to delete the AtomicStructure, but the Python code never finds out so the model is not closed and errors ensue as shown in the traceback below hovering the mouse over the dead model.
Probably the Python code should control the lifetime of the C++ objects so the Python can clean everything up before the C++ data structures are deleted. Deleting all atoms should not cause the AtomicStructure to delete itself. Instead the delete command should check the models that atoms were deleted from and close them if they have no atoms, likewise the delete command should check for empty residues and delete them.
Traceback (most recent call last):
File "/Users/goddard/ucsf/chimerax/ChimeraX.app/Contents/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/chimerax/core/ui/graphics.py", line 344, in _redraw_timer_callback
or self.mouse_modes.mouse_pause_tracking()
File "/Users/goddard/ucsf/chimerax/ChimeraX.app/Contents/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/chimerax/core/ui/mousemodes.py", line 512, in mouse_pause_tracking
self._mouse_pause()
File "/Users/goddard/ucsf/chimerax/ChimeraX.app/Contents/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/chimerax/core/ui/mousemodes.py", line 598, in _mouse_pause
m.pause(self._mouse_pause_position)
File "/Users/goddard/ucsf/chimerax/ChimeraX.app/Contents/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/chimerax/core/ui/mousemodes.py", line 929, in pause
p = self.view.first_intercept(x,y)
File "/Users/goddard/ucsf/chimerax/ChimeraX.app/Contents/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/chimerax/core/graphics/view.py", line 690, in first_intercept
p = self.drawing.first_intercept(xyz1, xyz2, exclude='is_outline_box')
File "/Users/goddard/ucsf/chimerax/ChimeraX.app/Contents/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/chimerax/core/graphics/drawing.py", line 761, in first_intercept
p = self.first_intercept_children(self.child_drawings(), mxyz1, mxyz2, exclude)
File "/Users/goddard/ucsf/chimerax/ChimeraX.app/Contents/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/chimerax/core/graphics/drawing.py", line 777, in first_intercept_children
p = d.first_intercept(cxyz1, cxyz2, exclude)
File "/Users/goddard/ucsf/chimerax/ChimeraX.app/Contents/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/chimerax/core/atomic/structure.py", line 938, in first_intercept
pb = self._bond_first_intercept(xyz1, xyz2)
File "/Users/goddard/ucsf/chimerax/ChimeraX.app/Contents/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/chimerax/core/atomic/structure.py", line 986, in _bond_first_intercept
b,f = _bond_intercept(self.bonds, mxyz1, mxyz2)
File "/Users/goddard/ucsf/chimerax/ChimeraX.app/Contents/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/chimerax/core/atomic/molc.py", line 83, in get_prop
vcount = getattr(self, value_count)
File "/Users/goddard/ucsf/chimerax/ChimeraX.app/Contents/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/chimerax/core/atomic/molc.py", line 25, in get_prop
cget(self._c_pointer_ref, 1, v_ref)
AttributeError: 'AtomicStructure' object has no attribute '_c_pointer_ref'
Change History (3)
comment:1 by , 9 years ago
| Status: | new → accepted |
|---|
comment:2 by , 9 years ago
| Cc: | added |
|---|
comment:3 by , 9 years ago
| Resolution: | → fixed |
|---|---|
| Status: | accepted → closed |
Deletion control largely remains in the C++ layer, but otherwise this problem is fixed. After deleting the atoms, the delete command checks whether the AtomicStructure got deleted and if so, it closes it.