Hi,
The error I’m having while compiling my code is this:
[quote]*** glibc detected *** /afs/cern.ch/sw/lcg/app/releases/ROOT/5.34.00/x86_64-slc5-gcc43-opt/root/bin/root.exe: free(): invalid pointer: 0x000000001938cf28 ***
[/quote]
My (simplified) code:
[code]
TMultiGraph mgboth [2];
for(int ii=0; ii<2; ii++){
c->cd(ii+1);
for (int i = 0+4*ii; i<4+4*ii; i++){
mgboth[ii].Add(graph_e+i);
graph_e[i].SetMarkerColor(2+i);
graph_e[i].SetMarkerStyle(7);
graph_e[i].GetXaxis()->SetTimeDisplay(1);
}
//some draw options here
mgboth[ii].Draw();
gStyle->SetTimeOffset(timeoffset);
mgboth[ii].Draw("AP");
}[/code]
From cout << __LINE__ << endl;
I discovered the problem is happening when the for loop has finished the last iteration. It will probably has something to do with automatical deletes by C++ but I have no clue why.
Has anyone a clue why C++ cannot finish this for-loop?
Thanks