306 // Don't bother during program termination |
306 // Don't bother during program termination |
307 if (IsExiting() or isDestructed()) |
307 if (IsExiting() or isDestructed()) |
308 return; |
308 return; |
309 |
309 |
310 // If this object was selected, unselect it now |
310 // If this object was selected, unselect it now |
311 if (isSelected()) |
311 if (isSelected() and document() != null) |
312 deselect(); |
312 deselect(); |
313 |
313 |
314 // If this object was associated to a file, remove it off it now |
314 // If this object was associated to a file, remove it off it now |
315 if (document() != null) |
315 if (document() != null) |
316 document().toStrongRef()->forgetObject (self()); |
316 document().toStrongRef()->forgetObject (self()); |