Пример #1
0
/** Function called when observer objects receives a notification that
 * a workspace has been deleted.
 *
 * This checks if the "original workspace" in this object is being deleted,
 * and removes the reference to it to allow it to be destructed properly.
 *
 * @param notice :: notification of workspace deletion
 */
void MDGeometry::deleteNotificationReceived(
    Mantid::API::WorkspacePreDeleteNotification_ptr notice) {
  for (auto &original : m_originalWorkspaces) {
    if (original) {
      // Compare the pointer being deleted to the one stored as the original.
      Workspace_sptr deleted = notice->object();
      if (original == deleted) {
        // Clear the reference
        original.reset();
      }
    }
  }
}
Пример #2
0
 void deleteNotificationReceived(
     Mantid::API::WorkspacePreDeleteNotification_ptr notice) {
   m_parent.deleteNotificationReceived(notice->object());
 }