Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 9253 for code/trunk/src


Ignore:
Timestamp:
May 28, 2012, 12:13:00 AM (13 years ago)
Author:
landauf
Message:

fixed crash in NotificationQueue - iterators are not guaranteed to be accessible after erasing them from the set

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/trunk/src/modules/notifications/NotificationQueue.cc

    r8858 r9253  
    4545
    4646    CreateFactory(NotificationQueue);
    47    
     47
    4848    /**
    4949    @brief
     
    6262
    6363        this->creationTime_ = std::time(0);
    64        
     64
    6565        this->registerVariables();
    6666    }
     
    111111        if(this->isRegistered())
    112112            this->clear();
    113            
     113
    114114        this->create();
    115115
     
    171171        XMLPortParam(NotificationQueue, "displayTime", setDisplayTime, getDisplayTime, xmlelement, mode);
    172172    }
    173    
    174    
     173
     174
    175175    /**
    176176    @brief
     
    313313        orxout(verbose_more, context::notifications) << "Notification \"" << (*it)->notification->getMessage() << "\" removed from NotificationQueue '" << this->getName() << "'" << endl;
    314314
     315        delete *containerIterator;
     316
    315317        this->ordering_.erase(containerIterator);
    316318        this->notifications_.erase(it);
    317319
    318320        this->size_--;
    319 
    320         delete *containerIterator;
    321321
    322322        // TODO: index automatically cast?
     
    370370            return;
    371371        }
    372        
     372
    373373        this->maxSize_ = size;
    374374        this->maxSizeChanged();
     
    400400            orxout(internal_warning, context::notifications) << "Trying to set display time of NotificationQueue '" << this->getName() << "' to non-positive value. Ignoring..." << endl;
    401401        }
    402            
     402
    403403        this->displayTime_ = time;
    404404        this->displayTimeChanged();
Note: See TracChangeset for help on using the changeset viewer.