Update of /cvsroot/mahogany/M/src/modules
In directory sc8-pr-cvs1:/tmp/cvs-serv5306/src/modules

Modified Files:
        BareBonesEditor.cpp 
Log Message:
fixed memory leak (all attachments were leaked) and crash when pressing Del under 
Windows

Index: BareBonesEditor.cpp
===================================================================
RCS file: /cvsroot/mahogany/M/src/modules/BareBonesEditor.cpp,v
retrieving revision 1.18
retrieving revision 1.19
diff -b -u -2 -r1.18 -r1.19
--- BareBonesEditor.cpp 1 Oct 2003 00:35:12 -0000       1.18
+++ BareBonesEditor.cpp 1 Oct 2003 23:07:02 -0000       1.19
@@ -679,4 +679,5 @@
          wxListItem item;
          item.SetId(selected);
+         item.SetMask(wxLIST_MASK_DATA);
          GetItem(item);
 
@@ -685,4 +686,5 @@
          DeleteItem(selected);
 
+         if ( part )
          part->DecRef();
       }
@@ -760,12 +762,13 @@
 BareBonesEditor::~BareBonesEditor()
 {
-   int itemIndex;
-
-   // DecRef all EditorContentPart objects in wxListCtrl, that's all
-   for(itemIndex = 0; itemIndex < m_attachments->GetItemCount(); ++itemIndex)
+   // free all EditorContentPart objects in wxListCtrl
+   const int count = m_attachments->GetItemCount();
+   for ( int itemIndex = 0; itemIndex < count; ++itemIndex )
    {
       wxListItem itemProperties;
 
       itemProperties.SetId(itemIndex);
+      itemProperties.SetMask(wxLIST_MASK_DATA);
+
       m_attachments->GetItem(itemProperties);
 



-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
Mahogany-cvsupdates mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/mahogany-cvsupdates

Reply via email to