Make sure that stack is properly initialized on a per-thread basis. Fixes #95wq
This commit is contained in:
parent
f7086c10ec
commit
f5f99961c1
@ -209,8 +209,6 @@ namespace chaiscript
|
|||||||
Dispatch_Engine()
|
Dispatch_Engine()
|
||||||
: m_place_holder(boost::shared_ptr<Placeholder_Object>(new Placeholder_Object()))
|
: m_place_holder(boost::shared_ptr<Placeholder_Object>(new Placeholder_Object()))
|
||||||
{
|
{
|
||||||
StackData &stack = get_stack_data();
|
|
||||||
stack.get<1>().push_back(Scope());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
~Dispatch_Engine()
|
~Dispatch_Engine()
|
||||||
@ -748,6 +746,7 @@ namespace chaiscript
|
|||||||
Stack_Holder()
|
Stack_Holder()
|
||||||
: stack(new StackData())
|
: stack(new StackData())
|
||||||
{
|
{
|
||||||
|
stack->get<1>().push_back(Scope());
|
||||||
stack->get<2>() = true;
|
stack->get<2>() = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -13,7 +13,9 @@
|
|||||||
|
|
||||||
void do_work(chaiscript::ChaiScript &c)
|
void do_work(chaiscript::ChaiScript &c)
|
||||||
{
|
{
|
||||||
// c("use(\"work.chai\"); do_chai_work(num_iterations);");
|
// c("use(\"work.chai\"); do_chai_work(num_iterations);");
|
||||||
|
std::string name = "MyVar" + boost::lexical_cast<std::string>(rand());
|
||||||
|
c.add(chaiscript::var(5), name);
|
||||||
c("use(\"work.chai\"); do_chai_work(10000);");
|
c("use(\"work.chai\"); do_chai_work(10000);");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user