model_server/gala/src/viewerMenu.cxx
/*
Destroys the contents of the item list
*/
Destroys the contents of the item list
Destroys the contents of the item list
void ViewerMenu::Destroy()
{
  ViewerMenu* m = sMenuList_;
  if (!m)			
    printf("@ViewerMenu::sMenuList_ is NULL!\n");	
  else if ( m->id_ == id_)	
    sMenuList_ = sMenuList_->nextMenu_;
  else		
    {
    while (m->nextMenu_ && m->nextMenu_->id_ != id_)
      m = m->nextMenu_;
    if (m->nextMenu_)		
      m->nextMenu_ = m->nextMenu_->nextMenu_;
    else
       {
       printf("@ViewerMenu::Destroy()\t");
       printf("Unable to find menu id #%d in global list!!!\n", id_);
       }
    }
  delete argList_;
  if (myItemList_) {
    myItemList_->DestroyList();
    delete myItemList_;
    myItemList_ = NULL;
  }
  vmenu::Destroy();
}
void ViewerMenu :: Destroy ( ) { ViewerMenu * m = sMenuList_ ; if ( ! m ) printf ( " \n " ) ; else if ( m -> id_ == id_ ) sMenuList_ = sMenuList_ -> nextMenu_ ; else { while ( m -> nextMenu_ && m -> nextMenu_ -> id_ != id_ ) m = m -> nextMenu_ ; if ( m -> nextMenu_ ) m -> nextMenu_ = m -> nextMenu_ -> nextMenu_ ; else { printf ( " \t " ) ; printf ( " \n " , id_ ) ; } } delete argList_ ; if ( myItemList_ ) { myItemList_ -> DestroyList ( ) ; delete myItemList_ ; myItemList_ = NULL ; } vmenu :: Destroy ( ) ; }
Destroys the contents of the item list
Destroys the contents of the item list
// Remove this menu from the global list. // Null global list! // First in the list. // Check the rest of the list. // Found it. // Delete stuff we added. // Call standard destroy.