Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 3198 for code/trunk/src/util


Ignore:
Timestamp:
Jun 20, 2009, 4:27:38 PM (15 years ago)
Author:
scheusso
Message:

merged netp4 back to trunk

Location:
code/trunk/src/util
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/trunk/src/util/OutputBuffer.cc

    r3196 r3198  
    3636namespace orxonox
    3737{
    38     const int OUTPUTBUFFER_MAX_LINE_LENGTH = 16384; //! The maximal number of lines that can be stored within the OutputBuffer.
    39 
    4038    /**
    4139        @brief Adds a new listener to the list.
     
    105103    bool OutputBuffer::getLine(std::string* output)
    106104    {
    107         char line[OUTPUTBUFFER_MAX_LINE_LENGTH];
    108 
    109         this->stream_.getline(line, OUTPUTBUFFER_MAX_LINE_LENGTH);
    110         (*output) = std::string(line);
     105        std::getline(this->stream_, *output);
    111106
    112107        bool eof = this->stream_.eof();
  • code/trunk/src/util/SignalHandler.cc

    r3196 r3198  
    107107    void SignalHandler::sigHandler( int sig )
    108108    {
    109       for ( SignalCallbackList::iterator it = SignalHandler::getInstance().callbackList.begin(); it != SignalHandler::getInstance().callbackList.end(); it++  )
    110       {
    111         (*(it->cb))( it->someData );
    112       }
    113 
    114109      std::string sigName = "UNKNOWN";
    115110
     
    126121          break;
    127122      }
     123      // if the signalhandler has already been destroyed then don't do anything
     124      if( SignalHandler::singletonRef_s == 0 )
     125      {
     126        COUT(0) << "recieved signal " << sigName.c_str() << std::endl << "can't write backtrace because SignalHandler already destroyed" << std::endl;
     127        exit(EXIT_FAILURE);
     128      }
     129
     130      for ( SignalCallbackList::iterator it = SignalHandler::getInstance().callbackList.begin(); it != SignalHandler::getInstance().callbackList.end(); it++  )
     131      {
     132        (*(it->cb))( it->someData );
     133      }
     134
    128135
    129136      COUT(0) << "recieved signal " << sigName.c_str() << std::endl << "try to write backtrace to file orxonox_crash.log" << std::endl;
Note: See TracChangeset for help on using the changeset viewer.