Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Sep 16, 2008, 8:45:13 PM (16 years ago)
Author:
rgrieder
Message:

Changed initialisation of TclThreadManager, TclBind and Shell to match the simple singleton concept (runtime assert in the c'tor).
That simplifies things a lot. The instances now 'belong' to GSRoot.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/trunk/src/core/Shell.cc

    r1755 r1792  
    5050    SetConsoleCommandShortcut(OutputHandler, debug);
    5151
     52    Shell* Shell::singletonRef_s = 0;
     53
    5254    Shell::Shell()
    5355    {
     56        assert(singletonRef_s == 0);
     57        singletonRef_s = this;
     58
     59        int level = Core::getSoftDebugLevel(OutputHandler::LD_Shell);
     60        Core::setSoftDebugLevel(OutputHandler::LD_Shell, -1);
     61
    5462        RegisterRootObject(Shell);
    5563
     
    7078
    7179        this->setConfigValues();
     80
     81        Core::setSoftDebugLevel(OutputHandler::LD_Shell, level);
    7282    }
    7383
     
    7686        if (this->inputBuffer_)
    7787            delete this->inputBuffer_;
    78     }
    79 
    80     Shell& Shell::createShell()
    81     {
    82         int level = Core::getSoftDebugLevel(OutputHandler::LD_Shell);
    83         Core::setSoftDebugLevel(OutputHandler::LD_Shell, -1);
    84         static Shell instance;
    85         Core::setSoftDebugLevel(OutputHandler::LD_Shell, level);
    86         return instance;
    87     }
    88 
    89     Shell& Shell::getInstance()
    90     {
    91         static Shell& instance = createShell();
    92         return instance;
     88        singletonRef_s = 0;
    9389    }
    9490
Note: See TracChangeset for help on using the changeset viewer.