Boost logo

Boost Users :

From: Elisha Berns (e.berns_at_[hidden])
Date: 2005-08-24 22:48:26


HI,

There is a small memory leak reported by VC7.1 just by declaring a
boost::mutex (presumably). Since this makes no sense at all, perhaps
there is some explanation for this behavior in this compiler. The code
looks like this:

In the class definition:

mutable boost::mutex m_orphan_annotation_mutex;

(It's only declared mutable because it's used in 'const' methods also).

In the .cpp file:

void OrphanedAnnotationMap::IndexOrphanedAnnotations()
{
        boost::thread indexer(
                boost::bind(&OrphanedAnnotationMap::Index, this));

        boost::mutex::scoped_lock lock(m_orphan_annotation_mutex);

        indexer.join();
}

The memory dump is this:

Detected memory leaks!
Dumping objects ->
{146} normal block at 0x00227008, 24 bytes long.
 Data: < | > 08 7C 04 00 FF FF FF FF 00 00 00 00 00 00 00
00
{145} normal block at 0x00223928, 8 bytes long.
 Data: < p" > 08 70 22 00 01 CD CD CD
Object dump complete.

Elisha Berns
e.berns_at_[hidden]
tel. (310) 556 - 8332
fax (310) 556 - 2839


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net