Update of /cvsroot/mahogany/M/src/mail
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21683/src/mail
Modified Files:
ThreadJWZ.cpp Threading.cpp
Log Message:
don't copy the threading tree around, reuse the one built by cclient when doing server
side threading
Index: ThreadJWZ.cpp
===================================================================
RCS file: /cvsroot/mahogany/M/src/mail/ThreadJWZ.cpp,v
retrieving revision 1.30
retrieving revision 1.31
diff -b -u -2 -r1.30 -r1.31
--- ThreadJWZ.cpp 12 Oct 2003 22:03:37 -0000 1.30
+++ ThreadJWZ.cpp 7 Apr 2004 22:59:25 -0000 1.31
@@ -1904,14 +1904,17 @@
// Copy the tree structure to a THREADNODE structure
//
-static THREADNODE* MapToThreadNode(Threadable* root) {
- if (!root) return 0;
- THREADNODE* thrNode = new THREADNODE;
- if (root->isDummy()) {
- thrNode->num = 0;
- } else {
- thrNode->num = root->getIndex()+1; // +1 for getting a msgno
- }
+static THREADNODE *MapToThreadNode(Threadable* root)
+{
+ if ( !root )
+ return NULL;
+
+ // we must allocate THREADNODEs with fs_get() as they're freed by cclient
+ THREADNODE *thrNode = mail_newthreadnode(NULL);
+
+ // +1 for getting a msgno
+ thrNode->num = root->isDummy() ? 0 : root->getIndex()+1;
thrNode->next = MapToThreadNode(root->getChild());
thrNode->branch = MapToThreadNode(root->getNext());
+
return thrNode;
}
Index: Threading.cpp
===================================================================
RCS file: /cvsroot/mahogany/M/src/mail/Threading.cpp,v
retrieving revision 1.7
retrieving revision 1.8
diff -b -u -2 -r1.7 -r1.8
--- Threading.cpp 18 Sep 2003 16:31:00 -0000 1.7
+++ Threading.cpp 7 Apr 2004 22:59:25 -0000 1.8
@@ -114,9 +114,11 @@
}
-static void DestroyThreadNodes(THREADNODE* n) {
- if (!n) return;
- DestroyThreadNodes(n->next);
- DestroyThreadNodes(n->branch);
- delete n;
+void ThreadData::killTree()
+{
+ if ( m_root )
+ {
+ mail_free_threadnode(&m_root);
+ m_root = NULL;
+ }
}
@@ -124,4 +126,5 @@
{
killTree();
+
delete [] m_tableThread;
delete [] m_children;
@@ -129,6 +132,2 @@
}
-void ThreadData::killTree() {
- DestroyThreadNodes(m_root);
- m_root = 0;
-}
-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
_______________________________________________
Mahogany-cvsupdates mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/mahogany-cvsupdates