[sldev] Incorrect cleanup in message.cpp / VWR-808

Nicholaz Beresford nicholaz at blueflash.cc
Tue May 22 00:13:04 PDT 2007


the LLMessageSystem object in llmessage/message.cpp has members as 
TemplateMessageBuilder and mLLSDMessageBuilder and 
mTemplateMessageReader and mLLSDMessageReader. These are allocated in 
the constructor.

There are additional pointer members which are used in the program to 
switch between the template and LLSD versions (for builder and reader).

In the destructor these switching-pointers are freed which is incorrect, 
because the allocated member version which is currently switched away 
fro (either the templates or the LLSD's) remain in memory.

Problem and patch debugged and confirmed in leak dump.


https://jira.secondlife.com/browse/VWR-808


Patch attached
-------------- next part --------------
--- linden-orig/indra/llmessage/message.cpp	2007-05-14 16:47:20.000000000 +0200
+++ linden/indra/llmessage/message.cpp	2007-05-22 09:11:45.562500000 +0200
@@ -1343,13 +1343,40 @@
 	{
 		end_net();
 	}
-	
-	delete mMessageReader;
+
+	// PATCH [Nicholaz Beresford]
+	// 
+
+	// deleters were wrong (member message builder and reader are just pointers
+	// which switch between the actually created object
+
+	// VWR-808
+
+	// delete mMessageReader;
 	mMessageReader = NULL;
 
-	delete mMessageBuilder;
+	// delete mMessageBuilder;
 	mMessageBuilder = NULL;
 
+
+	delete mTemplateMessageBuilder;
+	mTemplateMessageBuilder = NULL;
+
+	delete mLLSDMessageBuilder;
+	mLLSDMessageBuilder = NULL;
+
+	delete mTemplateMessageReader;
+	mTemplateMessageReader = NULL;
+
+	delete mLLSDMessageReader;
+	mLLSDMessageReader = NULL;
+	//
+	// ~PATCH
+
+
+
+
+
 	delete mPollInfop;
 	mPollInfop = NULL;
 


More information about the SLDev mailing list