diff options
Diffstat (limited to 'src/uscxml/plugins/datamodel/ecmascript/v8')
-rw-r--r-- | src/uscxml/plugins/datamodel/ecmascript/v8/V8DataModel.cpp | 8 | ||||
-rw-r--r-- | src/uscxml/plugins/datamodel/ecmascript/v8/V8DataModel.h | 2 |
2 files changed, 5 insertions, 5 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; |