Changeset 5206 in orxonox.OLD for trunk/src/lib/shell/shell_buffer.cc
- Timestamp:
- Sep 19, 2005, 12:31:56 AM (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/lib/shell/shell_buffer.cc
r5183 r5206 33 33 { 34 34 ShellBuffer::singletonRef = this; 35 this->shell = NULL; 35 36 36 37 this->lineCount = 0; … … 50 51 ShellBuffer::~ShellBuffer () 51 52 { 52 if ( Shell::isInstanciated())53 delete Shell::getInstance();53 if (this->shell != NULL) 54 delete this->shell; 54 55 55 56 this->flushBuffers(); … … 58 59 59 60 ShellBuffer::singletonRef = NULL; 61 } 62 63 /** 64 * registers the Shell to the Buffer 65 * @param shell the Shell to register. 66 */ 67 void ShellBuffer::registerShell(Shell* shell) 68 { 69 if (this->shell == NULL) 70 this->shell = shell; 71 else 72 PRINTF(1)("already registered a Shell to the ShellBuffer\n"); 73 } 74 75 /** 76 * unregisters the Shell from the Buffer 77 * @param shell the Shell to unregister. 78 */ 79 void ShellBuffer::unregisterShell(Shell* shell) 80 { 81 if (this->shell == shell) 82 this->shell = NULL; 83 else 84 PRINTF(1)("cannot unregister shell, because it is not registered to the ShellBuffer\n"); 60 85 } 61 86 … … 150 175 this->lineCount++; 151 176 this->buffer->add(addLine); 152 if ( Shell::isInstanciated() && Shell::getInstance()->isActive())153 Shell::getInstance()->printToDisplayBuffer(addLine);177 if (likely (this->shell != NULL) && unlikely (this->shell->isActive())) 178 this->shell->printToDisplayBuffer(addLine); 154 179 155 180 if (this->buffer->getSize() > this->bufferSize)
Note: See TracChangeset
for help on using the changeset viewer.