Skip to content
Snippets Groups Projects
Commit 1a79be08 authored by Fons Rademakers's avatar Fons Rademakers
Browse files

save the interpreter context just before calling the script, to avoid it

to wipe all symbols away with a possible gROOT->Reset().


git-svn-id: http://root.cern.ch/svn/root/trunk@38782 27541ba8-7e3a-0410-8455-c3a389f83636
parent 6566215e
No related branches found
No related tags found
No related merge requests found
......@@ -12,7 +12,8 @@
#include "TEnv.h"
#include "TVirtualX.h"
int saveScriptOutput(const char* script, const char* outdir, Bool_t compiled) {
int saveScriptOutput(const char* script, const char* outdir, Bool_t compiled)
{
// Run script and save all windows to
// outdir/script_0.png, outdir/script_1.png, ...
......@@ -34,6 +35,12 @@ int saveScriptOutput(const char* script, const char* outdir, Bool_t compiled) {
cmd += "+";
if (!gROOT->IsBatch())
gVirtualX->Sync(1);
// save current interpreter context to avoid gROOT->Reset()
// in the script to cause havoc by wiping everything away
gInterpreter->SaveContext();
gInterpreter->SaveGlobalsContext();
gROOT->ProcessLine(cmd, &err);
if (err != TInterpreter::kNoError)
return kCannotRunScript;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment