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/TclBind.cc

    r1747 r1792  
    2727 */
    2828
     29#include "TclBind.h"
     30
    2931#include <iostream>
    3032#include <string>
    31 
    3233#include "ConsoleCommand.h"
    3334#include "CommandExecutor.h"
    3435#include "TclThreadManager.h"
    35 #include "TclBind.h"
    3636#include "util/Debug.h"
    3737#include "util/String.h"
     
    4242    SetConsoleCommandShortcut(TclBind, bgerror);
    4343
    44     TclBind::TclBind()
     44    TclBind* TclBind::singletonRef_s = 0;
     45
     46    TclBind::TclBind(const std::string& datapath)
    4547    {
     48        assert(singletonRef_s == 0);
     49        singletonRef_s = this;
    4650        this->interpreter_ = 0;
    4751        this->bSetTclLibPath_ = false;
     52        this->setDataPath(datapath);
    4853    }
    4954
     
    5257        if (this->interpreter_)
    5358            delete this->interpreter_;
    54     }
    55 
    56     TclBind& TclBind::getInstance()
    57     {
    58         static TclBind instance;
    59         return instance;
     59        singletonRef_s = 0;
    6060    }
    6161
Note: See TracChangeset for help on using the changeset viewer.