diff options
author | Stefan Radomski <radomski@tk.informatik.tu-darmstadt.de> | 2013-01-13 02:20:15 (GMT) |
---|---|---|
committer | Stefan Radomski <radomski@tk.informatik.tu-darmstadt.de> | 2013-01-13 02:20:15 (GMT) |
commit | c443aaa23e079d8ab94942bfefa65b940c1acd01 (patch) | |
tree | beab36f1446339fe1b157c349c0808e4f5106982 /src/uscxml/plugins/datamodel | |
parent | a116aeb2cf5a84fa03f9814c3884561149029267 (diff) | |
download | uscxml-c443aaa23e079d8ab94942bfefa65b940c1acd01.zip uscxml-c443aaa23e079d8ab94942bfefa65b940c1acd01.tar.gz uscxml-c443aaa23e079d8ab94942bfefa65b940c1acd01.tar.bz2 |
Fixed bugs intriduced by PIMPL
Diffstat (limited to 'src/uscxml/plugins/datamodel')
4 files changed, 8 insertions, 8 deletions
diff --git a/src/uscxml/plugins/datamodel/ecmascript/v8/V8DataModel.cpp b/src/uscxml/plugins/datamodel/ecmascript/v8/V8DataModel.cpp index 5ab9b3e..1aa181e 100644 --- a/src/uscxml/plugins/datamodel/ecmascript/v8/V8DataModel.cpp +++ b/src/uscxml/plugins/datamodel/ecmascript/v8/V8DataModel.cpp @@ -23,8 +23,8 @@ V8DataModel::V8DataModel() { // _contexts.push_back(v8::Context::New()); } -DataModelImpl* V8DataModel::create(Interpreter* interpreter) { - V8DataModel* dm = new V8DataModel(); +boost::shared_ptr<DataModelImpl> V8DataModel::create(Interpreter* interpreter) { + boost::shared_ptr<V8DataModel> dm = boost::shared_ptr<V8DataModel>(new V8DataModel()); dm->_interpreter = interpreter; v8::Locker locker; v8::HandleScope scope; @@ -38,8 +38,8 @@ DataModelImpl* V8DataModel::create(Interpreter* interpreter) { // some free functions v8::Handle<v8::ObjectTemplate> global = v8::ObjectTemplate::New(); - global->Set(v8::String::New("In"), v8::FunctionTemplate::New(jsIn, v8::External::New(reinterpret_cast<void*>(dm))), v8::ReadOnly); - global->Set(v8::String::New("print"), v8::FunctionTemplate::New(jsPrint, v8::External::New(reinterpret_cast<void*>(dm))), v8::ReadOnly); + global->Set(v8::String::New("In"), v8::FunctionTemplate::New(jsIn, v8::External::New(reinterpret_cast<void*>(dm.get()))), v8::ReadOnly); + global->Set(v8::String::New("print"), v8::FunctionTemplate::New(jsPrint, v8::External::New(reinterpret_cast<void*>(dm.get()))), v8::ReadOnly); v8::Persistent<v8::Context> context = v8::Context::New(0, global); v8::Context::Scope contextScope(context); diff --git a/src/uscxml/plugins/datamodel/ecmascript/v8/V8DataModel.h b/src/uscxml/plugins/datamodel/ecmascript/v8/V8DataModel.h index e5c1bc8..7e7bb8d 100644 --- a/src/uscxml/plugins/datamodel/ecmascript/v8/V8DataModel.h +++ b/src/uscxml/plugins/datamodel/ecmascript/v8/V8DataModel.h @@ -21,7 +21,7 @@ class V8DataModel : public DataModelImpl { public: V8DataModel(); virtual ~V8DataModel(); - virtual DataModelImpl* create(Interpreter* interpreter); + virtual boost::shared_ptr<DataModelImpl> create(Interpreter* interpreter); virtual std::set<std::string> getNames() { std::set<std::string> names; diff --git a/src/uscxml/plugins/datamodel/prolog/swi/SWIDataModel.cpp b/src/uscxml/plugins/datamodel/prolog/swi/SWIDataModel.cpp index 3e20867..5a33080 100644 --- a/src/uscxml/plugins/datamodel/prolog/swi/SWIDataModel.cpp +++ b/src/uscxml/plugins/datamodel/prolog/swi/SWIDataModel.cpp @@ -20,8 +20,8 @@ bool connect(pluma::Host& host) { SWIDataModel::SWIDataModel() { } -DataModelImpl* SWIDataModel::create(Interpreter* interpreter) { - SWIDataModel* dm = new SWIDataModel(); +boost::shared_ptr<DataModelImpl> SWIDataModel::create(Interpreter* interpreter) { + boost::shared_ptr<SWIDataModel> dm = boost::shared_ptr<SWIDataModel>(new SWIDataModel()); dm->_interpreter = interpreter; const char* swiPath = SWI_LIBRARY_PATH; dm->_plEngine = new PlEngine((char*)swiPath); diff --git a/src/uscxml/plugins/datamodel/prolog/swi/SWIDataModel.h b/src/uscxml/plugins/datamodel/prolog/swi/SWIDataModel.h index f5f5247..1d5a454 100644 --- a/src/uscxml/plugins/datamodel/prolog/swi/SWIDataModel.h +++ b/src/uscxml/plugins/datamodel/prolog/swi/SWIDataModel.h @@ -15,7 +15,7 @@ class SWIDataModel : public DataModelImpl { public: SWIDataModel(); virtual ~SWIDataModel(); - virtual DataModelImpl* create(Interpreter* interpreter); + virtual boost::shared_ptr<DataModelImpl> create(Interpreter* interpreter); virtual std::set<std::string> getNames() { std::set<std::string> names; |