Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Sep 10, 2008, 1:37:36 AM (16 years ago)
Author:
rgrieder
Message:

merged gui back to trunk.
update the media repository!

Location:
code/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/trunk

  • code/trunk/src/core/Shell.cc

    r1747 r1755  
    3333#include "Core.h"
    3434#include "ConsoleCommand.h"
    35 #include "input/InputInterfaces.h"
    3635#include "util/OutputHandler.h"
    3736
     
    6463        this->clearLines();
    6564
    66         this->inputBuffer_ = 0;
    67         this->setInputBuffer(new InputBuffer());
     65        this->inputBuffer_ = new InputBuffer();
     66        this->configureInputBuffer();
    6867
    6968        this->outputBuffer_.registerListener(this);
     
    7170
    7271        this->setConfigValues();
     72    }
     73
     74    Shell::~Shell()
     75    {
     76        if (this->inputBuffer_)
     77            delete this->inputBuffer_;
    7378    }
    7479
     
    113118    }
    114119
    115     void Shell::setInputBuffer(InputBuffer* buffer)
    116     {
    117         if (this->inputBuffer_)
    118         {
    119             this->inputBuffer_->unregisterListener(this);
    120             // TODO: may be very dangerous. InputManager already deletes InputBuffer instance!!!
    121             delete this->inputBuffer_;
    122         }
    123 
    124         this->inputBuffer_ = buffer;
     120    void Shell::configureInputBuffer()
     121    {
    125122        this->inputBuffer_->registerListener(this, &Shell::inputChanged, true);
    126123        this->inputBuffer_->registerListener(this, &Shell::execute, '\r', false);
Note: See TracChangeset for help on using the changeset viewer.