model_server/gala/src/viewer.cxx
/*deletes its view (which will in turn delete all of its children views), and removes
  itself form the viewers list.  If it is the only viewer, then it stops processing, and
  exits out of the program*/
deletes its view (which will in turn delete all of its children views), and removes
itself form the viewers list.  If it is the only viewer, then it stops processing, and
exits out of the program
deletes its view ( which will in turn delete all of its children views ) and removes itself form the viewers list . If it is the only viewer then it stops processing and exits out of the program
Viewer::~Viewer()
{
    gInit (Viewer::~Viewer);
    if (toolBar_) {
        toolBar_ = NULL;
    }
    if (_view) {
        delete _view;
        _view = NULL;
    }
    if (dialog) {
        dialog->SetViewer(NULL);
        dialog->DeleteLater();
        dialog = NULL;
    }
    if (commandLineView_) {
        commandLineView_ = NULL;
    }
    if (viewers == this) {    
      viewers = viewers->next;    
    } else {    
        for (Viewer* v=viewers; v->next == this; v=v->next);
        v->next = v->next->next;    
    }
        if(printer) {
                delete printer;
                printer = NULL;
        }
}
Viewer :: ~ Viewer ( ) { gInit ( Viewer :: ~ Viewer ) ; if ( toolBar_ ) { toolBar_ = NULL ; } if ( _view ) { delete _view ; _view = NULL ; } if ( dialog ) { dialog -> SetViewer ( NULL ) ; dialog -> DeleteLater ( ) ; dialog = NULL ; } if ( commandLineView_ ) { commandLineView_ = NULL ; } if ( viewers == this ) { viewers = viewers -> next ; } else { for ( Viewer * v = viewers ; v -> next == this ; v = v -> next ) ; v -> next = v -> next -> next ; } if ( printer ) { delete printer ; printer = NULL ; } }
deletes its view (which will in turn delete all of its children views), and removes
itself form the viewers list.
deletes its view ( which will in turn delete all of its children views ) and removes itself form the viewers list .
//toolBar_->DeleteLater(); Dialog deletes this? // Note - The Menu Bar will be deleted with the dialog because //        it is an item owned by the dialog. // The Command-Line is deleted with _view, but we still need to NULL it. // This viewer is at the front of the viewers list. // Remove this viewer from the list. // Must find the viewer. // Remove this viewer from the list.