Trying to understand a mem leak
<p>I'm working with VLD (Visual Leak Detector), and it detects some mem leaks. I'm trying to understand why this is a mem leak for VLD. It could be a false positive?</p>

<p>The code is very simple:</p>

<pre><code>    CGlobalLog* CGlobalLog::m_instance=NULL;  //static instance
    CGlobalLog::CGlobalLog()
    {
        minimiumLogLevel = LOGLEVEL_INFO;   
    }

    CGlobalLog::~CGlobalLog(void)
    {
        if(m_instance != NULL)
            delete m_instance;
    }

            // this method is static
    CGlobalLog&amp; CGlobalLog::getInstance()
    {

        if(m_instance == NULL){
            m_instance = new CGlobalLog();
        }
        return *m_instance;

    }
</code></pre>

<p>Where <code>LOGLEVEL</code> is an enum and m_instance is <code>CGlobalLog* CGlobalLog::m_instance</code>.
The trace is:</p>

<pre><code>WARNING: Visual Leak Detector detected memory leaks!
---------- Block 504 at 0x009B2290: 92 bytes ----------
  Call Stack:
    c:\users\ferran\directo\gameprojects2008\zeleste2d\src\log\globallog.cpp (26): LogSystem_v2.exe!glog::CGlobalLog::getInstance + 0x7 bytes
    c:\users\ferran\directo\gameprojects2008\zeleste2d\src\log\globallog.cpp (235): LogSystem_v2.exe!glog::CGlobalLog::exposeAPI
    c:\users\ferran\directo\gameprojects2008\games_and_samples\logsystem_v2\src\main.cpp (47): LogSystem_v2.exe!main + 0xB bytes
    f:\dd\vctools\crt_bld\self_x86\crt\src\crtexe.c (586): LogSystem_v2.exe!__tmainCRTStartup + 0x19 bytes
    f:\dd\vctools\crt_bld\self_x86\crt\src\crtexe.c (403): LogSystem_v2.exe!mainCRTStartup
    0x767D339A (File and line number not available): kernel32.dll!BaseThreadInitThunk + 0x12 bytes
    0x774D9ED2 (File and line number not available): ntdll.dll!RtlInitializeExceptionChain + 0x63 bytes
    0x774D9EA5 (File and line number not available): ntdll.dll!RtlInitializeExceptionChain + 0x36 bytes
  Data:
    00 00 00 00    CD CD CD CD    CD CD CD CD    CD CD CD CD     ........ ........
    CD CD CD CD    28 23 9B 00    00 00 00 00    00 00 00 00     ....(#.. ........
    CD CD CD CD    CD CD CD CD    CD CD CD CD    CD CD CD CD     ........ ........
    B0 23 9B 00    00 00 00 00    01 00 00 00    00 00 00 00     .#...... ........
    CD CD CD CD    00 CD CD CD    CD CD CD CD    CD CD CD CD     ........ ........
    CD CD CD CD    00 00 00 00    0F 00 00 00                    ........ ........
</code></pre>

<p>I couldn't find any reason for a mem leak.... could you helpme, please?
Thanks in advance</p>
