- Timestamp:
- Aug 25, 2005, 3:04:49 AM (19 years ago)
- Location:
- trunk/src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/lib/graphics/text_engine.cc
r5124 r5125 120 120 } 121 121 else 122 { 123 this->text = new char[1]; 124 *this->text = '\0'; 125 } 122 this->text = NULL; 126 123 } 127 124 … … 135 132 if (this->externText == NULL) 136 133 tmpText = this->text; 137 while (*tmpText != '\0') 134 if (tmpText != NULL) 135 { 136 while (*tmpText != '\0') 138 137 { 139 138 if(glyphArray[*tmpText]) 140 141 142 139 { 140 width += glyphArray[*tmpText]->width; 141 } 143 142 tmpText++; 144 143 } 145 this->width = width; 144 this->width = width; 145 } 146 146 } 147 147 } … … 205 205 if (this->externText == NULL) 206 206 tmpText = this->text; 207 while (*tmpText != '\0')207 if (likely(tmpText != NULL)) 208 208 { 209 if(glyphArray[*tmpText])209 while (*tmpText != '\0') 210 210 { 211 glCallList(glyphArray[*tmpText]->displayList); 212 glTranslatef(glyphArray[*tmpText]->width, 0, 0); 211 if(glyphArray[*tmpText]) 212 { 213 glCallList(glyphArray[*tmpText]->displayList); 214 glTranslatef(glyphArray[*tmpText]->width, 0, 0); 215 } 216 tmpText++; 213 217 } 214 tmpText++;215 }}218 } 219 } 216 220 else //(if type & TEXT_RENDER_STATIC) 217 221 { -
trunk/src/util/shell.cc
r5124 r5125 203 203 // remove all chars from the BufferTexts. 204 204 if (this->bufferText) 205 for (int i; i < this->bufferDisplaySize; i++) 206 { 207 this->bufferText[i]->setText(NULL); 208 } 209 205 for (int i = 0; i < this->bufferDisplaySize; i++) 206 { 207 this->bufferText[i]->setText(NULL, true); 208 } 210 209 211 210 // delete all the Chars in the Buffers 212 211 tIterator<char>* charIterator = this->buffer->getIterator(); 213 212 char* charElem = charIterator->firstElement(); 214 215 213 while (charElem != NULL) 216 214 { … … 220 218 } 221 219 delete charIterator; 220 delete this->buffer; 221 this->buffer = new tList<char>; 222 222 } 223 223 … … 343 343 if (likely(this->inputLine != NULL)) 344 344 { 345 delete 345 delete[] this->inputLine; 346 346 } 347 347 this->inputLine = new char[1]; 348 348 *this->inputLine = '\0'; 349 this->inputLineText->setText(this->inputLine, true); 349 350 } 350 351 … … 405 406 { 406 407 this->addBufferLineStatic("Execute Command: %s\n", this->inputLine); 407 delete this->inputLine; 408 this->inputLine = new char[1]; 409 this->inputLine[0]='\0'; 410 this->inputLineText->setText(this->inputLine); 408 409 if (!strcmp(this->inputLine, "clear")) 410 { 411 this->flushBuffers(); 412 } 413 414 this->flushInputLine(); 415 411 416 return false; 412 417 }
Note: See TracChangeset
for help on using the changeset viewer.