diff options
author | John Wiegley <johnw@newartisans.com> | 2009-02-08 21:16:29 -0400 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2009-02-08 21:16:29 -0400 |
commit | 3924a3da10145ede4a831a58ac184d3658d48aca (patch) | |
tree | 3384088b961869f75ed60268f3145cec67b7fa36 /src/global.cc | |
parent | d4d7090f3c673f092fdc2bba54e41582c85cff8b (diff) | |
download | fork-ledger-3924a3da10145ede4a831a58ac184d3658d48aca.tar.gz fork-ledger-3924a3da10145ede4a831a58ac184d3658d48aca.tar.bz2 fork-ledger-3924a3da10145ede4a831a58ac184d3658d48aca.zip |
pyinterp.cc shares global session; accept full paths passed to --import.
Diffstat (limited to 'src/global.cc')
-rw-r--r-- | src/global.cc | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/global.cc b/src/global.cc index 939a51b2..4d2f97fc 100644 --- a/src/global.cc +++ b/src/global.cc @@ -39,7 +39,14 @@ global_scope_t::global_scope_t(char ** envp) { TRACE_CTOR(global_scope_t, ""); - session_ptr.reset(new LEDGER_SESSION_T); +#if defined(HAVE_BOOST_PYTHON) + if (! python_session.get()) { + python_session.reset(new ledger::python_interpreter_t); + session_ptr = python_session; + } +#else + session_ptr.reset(new session_t); +#endif set_session_context(session_ptr.get()); @@ -75,6 +82,10 @@ global_scope_t::~global_scope_t() // object, and then shutting down the memory tracing subsystem. // Otherwise, let it all leak because we're about to exit anyway. IF_VERIFY() set_session_context(NULL); + +#if defined(HAVE_BOOST_PYTHON) + python_session.reset(); +#endif } void global_scope_t::read_init() |