Changeset 7315 in orxonox.OLD for trunk/src/lib/shell/shell_buffer.cc
- Timestamp:
- Apr 17, 2006, 1:32:25 AM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/lib/shell/shell_buffer.cc
r7314 r7315 90 90 void ShellBuffer::flush() 91 91 { 92 // delete all the Chars in the Buffers93 list<char*>::iterator bufferLine;94 for (bufferLine = this->buffer.begin(); bufferLine != this->buffer.end(); bufferLine++)95 {96 delete[] (*bufferLine);97 }98 92 this->buffer.clear(); 99 93 } … … 176 170 } 177 171 178 char* addLine = new char[strlen(newLineBegin)+1];179 strcpy(addLine, newLineBegin);180 181 172 this->lineCount++; 182 this->buffer.push_back( addLine);173 this->buffer.push_back(newLineBegin); 183 174 if (likely (this->shell != NULL) && unlikely (this->shell->isActive())) 184 this->shell->printToDisplayBuffer( addLine);175 this->shell->printToDisplayBuffer(newLineBegin); 185 176 186 177 if (this->buffer.size() > this->bufferSize) 187 {188 delete[] this->buffer.front();189 178 this->buffer.pop_front(); 190 }191 179 192 180 newLineBegin = newLineEnd+1; … … 201 189 PRINT(3)("Debugging output to console (not this shell)\n"); 202 190 203 list< char*>::const_iterator bufferLine;191 list<std::string>::const_iterator bufferLine; 204 192 for (bufferLine = this->buffer.begin(); bufferLine != this->buffer.end(); bufferLine++) 205 printf( *bufferLine);193 printf((*bufferLine).c_str()); 206 194 }
Note: See TracChangeset
for help on using the changeset viewer.