summaryrefslogtreecommitdiffstats
path: root/src/uscxml/plugins/datamodel/ecmascript/v8
diff options
context:
space:
mode:
authorStefan Radomski <radomski@tk.informatik.tu-darmstadt.de>2013-01-13 02:20:15 (GMT)
committerStefan Radomski <radomski@tk.informatik.tu-darmstadt.de>2013-01-13 02:20:15 (GMT)
commitc443aaa23e079d8ab94942bfefa65b940c1acd01 (patch)
treebeab36f1446339fe1b157c349c0808e4f5106982 /src/uscxml/plugins/datamodel/ecmascript/v8
parenta116aeb2cf5a84fa03f9814c3884561149029267 (diff)
downloaduscxml-c443aaa23e079d8ab94942bfefa65b940c1acd01.zip
uscxml-c443aaa23e079d8ab94942bfefa65b940c1acd01.tar.gz
uscxml-c443aaa23e079d8ab94942bfefa65b940c1acd01.tar.bz2
Fixed bugs intriduced by PIMPL
Diffstat (limited to 'src/uscxml/plugins/datamodel/ecmascript/v8')
-rw-r--r--src/uscxml/plugins/datamodel/ecmascript/v8/V8DataModel.cpp8
-rw-r--r--src/uscxml/plugins/datamodel/ecmascript/v8/V8DataModel.h2
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;