Community
cancel
Showing results for 
Search instead for 
Did you mean: 
DPart1
Beginner
97 Views

Kernel Resource Leak (or not)!

Inspector is flagging a kernel resource leak for this code:

523        BeginWaitCursor();   <------   This line is flagged as an error
524        GetDeepStack(this).Clear();
525        GetDeepStack(this).SetProgress(&dlg);
526        bOk = GetDeepStack(this).LoadStackedInfo(szFileName);
527        GetDeepStack(this).SetProgress(nullptr);
528        EndWaitCursor();

Why is it flagging a resource leak for line 523 when there is a matching EndWaitCursor() a few lines later.

Similarly it is reporting another leak for line 282 in this code:

274    ZPrivateResource :: ZPrivateResource()
275    #if defined(__MVS__)
276    : keyNameCl("")
277    #else                          
278    : resourceHandleCl(0)
279    #endif
280    {
281    #if defined(_WIN32)
282      resourceHandleCl = CreateMutex( 0, false, 0 );
283      if (resourceHandleCl == 0)

when the destructor VERY clearly has a CloseHandle() call at line 332:

326    ZPrivateResource :: ~ZPrivateResource()
327    {
328    #if !defined(__MVS__)
329      if (resourceHandleCl != 0)
330      {
331    # if defined(_WIN32)
332        CloseHandle( resourceHandleCl );
 

Thanks, David

0 Kudos
0 Replies
Reply