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

Modified Files:
        LayoutEditor.cpp 
Log Message:
fixed nasty memory corruption bug/crash which happened for the messages with 
attachments

Index: LayoutEditor.cpp
===================================================================
RCS file: /cvsroot/mahogany/M/src/modules/LayoutEditor.cpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -b -u -2 -r1.2 -r1.3
--- LayoutEditor.cpp    28 Mar 2002 15:26:39 -0000      1.2
+++ LayoutEditor.cpp    5 Apr 2002 15:12:46 -0000       1.3
@@ -185,9 +185,9 @@
 
    // get the real data back
-   EditorContentPart *GetContentPart() const { return m_mc; }
+   EditorContentPart *GetContentPart() const { m_mc->IncRef(); return m_mc; }
 
 protected:
    // nobody should delete us directly, we're ref counted
-   virtual ~LayoutEditData() { delete m_mc; }
+   virtual ~LayoutEditData() { m_mc->DecRef(); }
 
 private:
@@ -539,4 +539,6 @@
                   LayoutEditData *data = (LayoutEditData *)lo->GetUserData();
                   mc = data->GetContentPart();
+
+                  // undo IncRef() GetUserData() did
                   data->DecRef();
                }


_______________________________________________
Mahogany-cvsupdates mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/mahogany-cvsupdates

Reply via email to