Fix for: samples/example.cpp crashes #269

Add the system as global.
This commit is contained in:
Richard Powell 2016-05-14 09:40:22 -06:00
parent b72eed3921
commit ee68ff20ed

View File

@ -73,7 +73,7 @@ int main(int /*argc*/, char * /*argv*/[]) {
//Create a new system object and share it with the chaiscript engine
System system;
chai.add(var(&system), "system");
chai.add_global(var(&system), "system");
//Add a bound callback method
chai.add(fun(&System::add_callback, std::ref(system)), "add_callback_bound");