Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

My CMutex leaks memory

Status
Not open for further replies.

PerFnurt

Programmer
Feb 25, 2003
972
SE
Hiya,

I've got a tiny problem.

Code:
UINT MyThreadFunc(LPVOID pParam)
{
  // ...
  CMutex mutex(FALSE, "MyMutexName");
  while(somthing) { ... }
}

When the app. exits it report memory leaks in strcore.cpp (118). I've tracked it to the string param passed to the CMutex constructor.

Somehow CSyncObject's m_strName doesn't clean up properly.

Anyone familiar with this? Is Visual Studio just confused, or?







/Per

www.perfnurt.se
 
Nevermind, I figured it out. Naturally the thread func. need to exit properly for the destructor to be called.

/Per

www.perfnurt.se
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top