Revision 4f52a00091cb1482dbd90d7c225768c4080d51fa authored by Philippe Canal on 25 August 2011, 22:28:35 UTC, committed by Philippe Canal on 25 August 2011, 22:28:35 UTC
The generic collection proxy's Commit method no longer uses the environment object, so Allocate no longer need to mark it as used. This prevents a memory leak in the handling of associative containers stored in a TTree. git-svn-id: http://root.cern.ch/svn/root/branches/v5-28-00-patches@40716 27541ba8-7e3a-0410-8455-c3a389f83636
1 parent d587879
gtime.C
// Example of a graph of data moving in time
// Use the canvas "File/Quit" to exit from this example
//Author: Olivier Couet
void gtime() {
TCanvas *c1 = new TCanvas("c1");
const Int_t ng = 100;
const Int_t kNMAX = 10000;
Double_t *X = new Double_t[kNMAX];
Double_t *Y = new Double_t[kNMAX];
Int_t cursor = kNMAX;
TGraph *g = new TGraph(ng);
g->SetMarkerStyle(21);
g->SetMarkerColor(kBlue);
Double_t x = 0;
while (1) {
c1->Clear();
if (cursor > kNMAX-ng) {
for (Int_t i=0;i<ng;i++) {
X[i] = x;
Y[i] = sin(x);
x += 0.1;
}
g->Draw("alp");
cursor = 0;
} else {
x + = 0.1;
X[cursor+ng] = x;
Y[cursor+ng] = sin(x);
cursor++;
g->DrawGraph(ng,&X[cursor],&Y[cursor],"alp");
}
c1->Update();
gSystem->ProcessEvents();
gSystem->Sleep(10);
}
}
Computing file changes ...