From ee68ff20ed89ed6f618884eac92814c6c17e47b3 Mon Sep 17 00:00:00 2001 From: Richard Powell Date: Sat, 14 May 2016 09:40:22 -0600 Subject: [PATCH] Fix for: samples/example.cpp crashes #269 Add the system as global. --- samples/example.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/example.cpp b/samples/example.cpp index 507c5c0..0316ebf 100644 --- a/samples/example.cpp +++ b/samples/example.cpp @@ -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");