예제 #1
0
파일: MDGeometry.cpp 프로젝트: dezed/mantid
/** 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());
 }