Patch #2795 2009-07-30 20:04

techy

Various memory problem fixes (part 1)
Download
2795-Various_memory.patch (459 bytes)
Category
Application::Bugfix
Status
Accepted
Close date
2009-08-24 07:31
Assigned to
mortenmacfly
Index: src/sdk/encodingdetector.cpp
===================================================================
--- src/sdk/encodingdetector.cpp    (revision 5716)
+++ src/sdk/encodingdetector.cpp    (working copy)
@@ -189,7 +189,7 @@
             wxCSConv conv(m_Encoding);

             wideBuff = conv.cMB2WC((char*)buffer, size + 4 - m_BOMSizeInBytes, &outlen);

         }

-        delete tmp;

+        delete[] tmp;

     }

 

     m_ConvStr = wxString(wideBuff);
techy 2009-07-30 20:06

When testing with Valgrind I found several memory-related bugs (leaks and other errors). The following series of patches fixes most of them.

ollydbg 2009-08-11 17:29

@techy

Thanks!!!

There are so many bug fix.

By the way, it would be better if I can use Valgrind or other related memory leak detection tool under mingw&Windows.

techy 2009-08-17 22:31

Concerning your last sentence, from my perspective it would be better if the developers of Code::Blocks used Linux for development instead of Windows ;-).

Are the patches going to be applied to the mainline? Some of the memory leaks are really minor so they don't need to be fixed but some, like patch 2, are quite huge (you leak the whole contents of the file when switching to another file by F11 and in other cases as well) and also the memory errors should be fixed. And I'd also like to see the 2 additional patches as a part of the mainline so I don't have to apply them manually every time (and of course, other people would benefit from them as well IMO).

mortenmacfly 2009-08-18 08:42

After testing they may be applied. Remember that Thomas also had some comments we need to discuss internally. So please be patient.

Concerning Linux: In fact *all* devs except me develop C::B under Linux for Linux. ;-)