From 9f10b44bdb7cdc202ee92d026069349af3be35ee Mon Sep 17 00:00:00 2001 From: Fons Rademakers <Fons.Rademakers@cern.ch> Date: Fri, 21 Jan 2005 15:19:02 +0000 Subject: [PATCH] delete fContainer to avoid memory leak. git-svn-id: http://root.cern.ch/svn/root/trunk@10975 27541ba8-7e3a-0410-8455-c3a389f83636 --- test/guitest.cxx | 7 ++++--- tutorials/guitest.C | 3 ++- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/test/guitest.cxx b/test/guitest.cxx index d3a6627f63f..bfa1920b220 100644 --- a/test/guitest.cxx +++ b/test/guitest.cxx @@ -1,4 +1,4 @@ -// @(#)root/test:$Name: $:$Id: guitest.cxx,v 1.46 2004/09/17 10:29:28 brun Exp $ +// @(#)root/test:$Name: $:$Id: guitest.cxx,v 1.47 2005/01/18 21:07:27 brun Exp $ // Author: Fons Rademakers 07/03/98 // guitest.cxx: test program for ROOT native GUI classes. @@ -625,7 +625,7 @@ TestMainFrame::TestMainFrame(const TGWindow *p, UInt_t w, UInt_t h) // use hierarchical cleaning for container fContainer->SetCleanup(kDeepCleanup); - // Fill canvas with 256 colored frames + // Fill canvas with 256 colored frames for (int i=0; i < 256; ++i) fCanvasWindow->AddFrame(new TGFrame(fCanvasWindow->GetContainer(), 32, 32, 0, (i+1)&255), @@ -679,6 +679,7 @@ TestMainFrame::~TestMainFrame() delete fCascade2Menu; delete fMenuNew1; delete fMenuNew2; + delete fContainer; } void TestMainFrame::CloseWindow() @@ -1649,7 +1650,7 @@ void TestShutter::AddShutterItem(const char *name, shutterData_t data[]) TGLayoutHints *l = new TGLayoutHints(kLHintsTop | kLHintsCenterX, 5, 5, 5, 0); - + item = new TGShutterItem(fShutter, new TGHotString(name), id++); container = (TGCompositeFrame *) item->GetContainer(); diff --git a/tutorials/guitest.C b/tutorials/guitest.C index 41f8729487b..17cc121978d 100644 --- a/tutorials/guitest.C +++ b/tutorials/guitest.C @@ -1,4 +1,4 @@ -// @(#)root/tutorials:$Name: $:$Id: guitest.C,v 1.48 2004/12/09 22:55:06 brun Exp $ +// @(#)root/tutorials:$Name: $:$Id: guitest.C,v 1.49 2005/01/18 21:07:27 brun Exp $ // Author: Fons Rademakers 22/10/2000 // guitest.C: test program for ROOT native GUI classes exactly like @@ -764,6 +764,7 @@ TestMainFrame::~TestMainFrame() delete fMenuNew1; delete fMenuNew2; + delete fContainer; delete fMain; } -- GitLab