RE: TImageDump error (1)

From: Olivier Couet <Olivier.Couet_at_cern.ch>
Date: Tue, 13 Feb 2007 15:07:01 +0100


Hi,
Your macro works for me with the latest ROOT.

-----Original Message-----
From: owner-roottalk_at_pcroot.cern.ch
[mailto:owner-roottalk_at_pcroot.cern.ch] On Behalf Of OKUMURA, Akira Sent: Tuesday, February 13, 2007 2:18 PM To: RootTalk
Subject: [ROOT] TImageDump error (1)

Hello ROOTers,

I wrote a short program which dumps a GIF image using TImageDump class. I found that the line "can->SetLeftMargin(0)" caused a runtime error. However Top/Bottom/Right work well. How can I avoid this error?

The error message is;
*** glibc detected *** double free or corruption (!prev): 0x08fa63c8 ***Aborted

ROOT version is 5.14 for SL 4.4

Sincerely

OKUMURA, Akira oxon_at_icrr.u-tokyo.ac.jp
Institute for Cosmic Ray Research, University of Tokyo 5-1-5 Kashiwanoha Kashiwa Chiba 277-8582 Japan Phone/Fax : +81 4-7136-3153 Skype : okumura.akira


$ g++ test.cxx -o test `root-config --libs --cflags`


#include "TImageDump.h"
#include "TCanvas.h"
#include "TH2D.h"

int main()
{

   TCanvas* can = new TCanvas("can", "can", 100, 100);

   can->SetLeftMargin(0); // <= this cause an error
   can->SetTopMargin(0);
   can->SetRightMargin(0);
   can->SetBottomMargin(0);

   TH2D* hist = new TH2D("hist", "hist", 1, 0, 1, 1, 0, 1);    hist->Draw();

   TImageDump dump("test.gif");
   can->Paint();

   dump.Close();

   return 0;
} Received on Tue Feb 13 2007 - 15:07:08 CET

This archive was generated by hypermail 2.2.0 : Tue Feb 13 2007 - 23:50:02 CET