This is the line that causes the strang exceptions when closing and/or deleting figures.