google mock with boost::test causes memory leak
<p>I am trying to create unit tests using boost::test and google mock.
Adding a call to InitGoogleMock causes boost to signal some memory leaks. I searched for some sort of "DeInitGoogleMock" but didn't find any. </p>

<p>Why does this memory leak come up? How can it be fixed?</p>

<p>main.cpp:</p>

<pre><code>#include &lt;gmock/gmock.h&gt;

#define BOOST_TEST_MODULE my_testt
#include &lt;boost/test/unit_test.hpp&gt;

struct InitGMock {
  InitGMock() {
    ::testing::GTEST_FLAG(throw_on_failure) = true;
    //::testing::InitGoogleMock(&amp;boost::unit_test::framework::master_test_suite().argc,
    //  boost::unit_test::framework::master_test_suite().argv);
  }

  ~InitGMock() { }
};

BOOST_GLOBAL_FIXTURE(InitGMock);

BOOST_AUTO_TEST_CASE( test_case )
{
  BOOST_CHECK( true );
}
</code></pre>

<p>Output:</p>

<pre><code>Running 1 test case...
*** No errors detected
</code></pre>

<p>Output after uncommenting the InitGoogleMock lines:</p>

<pre><code>Running 1 test case...
*** No errors detected
Detected memory leaks!
Dumping objects -&gt;
{669} normal block at 0x00B4E700, 48 bytes long.
 Data: &lt;                &gt; 00 E7 B4 00 00 E7 B4 00 00 E7 B4 00 CD CD CD CD
{668} normal block at 0x00B473B0, 28 bytes long.
 Data: &lt;                &gt; 00 00 00 00 CD CD CD CD CD CD CD CD CD CD CD CD
{667} normal block at 0x00B471B8, 24 bytes long.
 Data: &lt;                &gt; FF FF FF FF FF FF FF FF 00 00 00 00 00 00 00 00
Object dump complete.
</code></pre>