changeset 2464:663ef593022e

2008-02-11 John Dallaway <jld@ecoscentric.com> * standalone/wxwin/configitem.cpp: Fix memory leak when unloading a package. [ Bugzilla 1000072 ] * standalone/wxwin/mainwin.cpp: About dialog box update.
author jld
date Mon, 11 Feb 2008 07:47:09 +0000
parents 4fa061bf5e97
children dbff0fb46d3b
files host/tools/configtool/ChangeLog host/tools/configtool/standalone/wxwin/configitem.cpp host/tools/configtool/standalone/wxwin/mainwin.cpp
diffstat 3 files changed, 10 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/host/tools/configtool/ChangeLog
+++ b/host/tools/configtool/ChangeLog
@@ -1,3 +1,8 @@
+2008-02-11  John Dallaway  <jld@ecoscentric.com>
+
+	* standalone/wxwin/configitem.cpp: Fix memory leak when unloading a
+	package. [ Bugzilla 1000072 ]
+
 2007-10-25  Gary Thomas  <gary@mlbassoc.com>
 
 	* standalone/wxwin/propertywin.h: Remove class qualifier - not
--- a/host/tools/configtool/standalone/wxwin/configitem.cpp
+++ b/host/tools/configtool/standalone/wxwin/configitem.cpp
@@ -2,7 +2,7 @@
 //
 // ----------------------------------------------------------------------------
 // Copyright (C) 1998, 1999, 2000 Red Hat, Inc.
-// Copyright (C) 2006 eCosCentric Limited
+// Copyright (C) 2006, 2008 eCosCentric Limited
 //
 // This program is part of the eCos host tools.
 //
@@ -718,6 +718,8 @@ bool ecConfigItem::Unload()
         {
             item->SetTreeItem(wxTreeItemId()); // Make sure we can't attempt to paint it
             item->SetCdlItem(NULL); // Make sure we can't access stale data
+            pDoc->GetItems().DeleteObject(this); // Delete from the item list
+            delete item; // Delete the item itself
         }
         node = node->Next();
     }
--- a/host/tools/configtool/standalone/wxwin/mainwin.cpp
+++ b/host/tools/configtool/standalone/wxwin/mainwin.cpp
@@ -3,7 +3,7 @@
 // ----------------------------------------------------------------------------
 // Copyright (C) 1998, 1999, 2000 Red Hat, Inc.
 // Copyright (C) 2003 John Dallaway
-// Copyright (C) 2004, 2005, 2006 eCosCentric Limited
+// Copyright (C) 2004, 2005, 2006, 2008 eCosCentric Limited
 //
 // This program is part of the eCos host tools.
 //
@@ -552,7 +552,7 @@ void ecMainFrame::OnAbout(wxCommandEvent
 //    ecAboutDialog dialog(this, ecID_ABOUT_DIALOG, _("About eCos Configuration Tool"));
 //    dialog.ShowModal();
 	wxString msg;
-	msg.Printf("eCos Configuration Tool %s (%s %s)\n\nCopyright (c) Red Hat, Inc. 1998-2002\nCopyright (c) John Dallaway 2003\nCopyright (c) eCosCentric Limited 2004-2006", ecCONFIGURATION_TOOL_VERSION, __DATE__, __TIME__);
+	msg.Printf("eCos Configuration Tool %s (%s %s)\n\nCopyright (c) Red Hat, Inc. 1998-2002\nCopyright (c) John Dallaway 2003\nCopyright (c) eCosCentric Limited 2004-2008", ecCONFIGURATION_TOOL_VERSION, __DATE__, __TIME__);
     wxMessageBox(msg, _("About eCos Configuration Tool"), wxICON_INFORMATION | wxOK);
 }