TROOT root("Rint","The ROOT Interactive Interface", initfuncs);
main(int argc, char **argv) {
TRint* theApp = new TRint("example 1", &argc, argv, NULL, 0);
theApp->Run(kTRUE);
delete theApp;
theApp = new TRint("example 2", &argc, argv, NULL, 0);
theApp->Run(kTRUE);
delete theApp;
}
--------------------------------------------------------------------------------
which prototypes 2 subsequent calls to ROOT event loop. This example generates
diagnostics:
root [0] .q
root [1] Error in <TApplication::TApplication>: only one instance of TApplication allowed
The diagnostics is due to the fact that TRint::TRint(..) ctor does some nontrivial
actions including dynamic memory allocations and registering allocated pointers in
gSystem. The destructor for TRint class does however nothing:
--------------------------------------------------------- RINT_Rint.cxx
TRint::~TRint()
{
}
--------------------------------------------------------------------------------
so the second call to constructor interferes with the first one.
Is it a design feature or a place which should be fixed?
Thanks, Pasha