Add object dependency tracking to make sure that during nested function calls all returned values are not prematurely destructed.

All tests pass on vc2008 now.
This commit is contained in:
Jason Turner
2010-10-02 13:26:06 +00:00
parent 43dbd8ac78
commit 74e719c053
5 changed files with 106 additions and 58 deletions

View File

@@ -132,10 +132,6 @@ namespace chaiscript
virtual ~Dispatch_Function() {}
virtual Boxed_Value operator()(const std::vector<Boxed_Value> &params) const
{
return dispatch(m_funcs.begin(), m_funcs.end(), params);
}
virtual int get_arity() const
{
@@ -167,6 +163,12 @@ namespace chaiscript
return "";
}
protected:
virtual Boxed_Value do_call(const std::vector<Boxed_Value> &params) const
{
return dispatch(m_funcs.begin(), m_funcs.end(), params);
}
private:
std::vector<std::pair<std::string, Proxy_Function > > m_funcs;
};