Click here to Skip to main content
15,887,585 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: returning const member data Pin
prasad_som19-Oct-06 23:06
prasad_som19-Oct-06 23:06 
GeneralRe: returning const member data Pin
minkowski19-Oct-06 23:16
minkowski19-Oct-06 23:16 
QuestionBitmap Printing Pin
kk.tvm19-Oct-06 22:37
kk.tvm19-Oct-06 22:37 
AnswerRe: Bitmap Printing Pin
Hamid_RT20-Oct-06 0:06
Hamid_RT20-Oct-06 0:06 
QuestionMDI Childs Pin
baerten19-Oct-06 22:28
baerten19-Oct-06 22:28 
QuestionRe: MDI Childs Pin
prasad_som20-Oct-06 0:08
prasad_som20-Oct-06 0:08 
QuestionRe: MDI Childs [modified] Pin
baerten20-Oct-06 1:08
baerten20-Oct-06 1:08 
Questionmemory leaks using pdh library Pin
m.dietz19-Oct-06 21:48
m.dietz19-Oct-06 21:48 
Hi,

I'm using the pdh library to monitor the allocated private bytes in order to find memory leaks in a big project. Now I realized that my class isn't leakfree itself, the constructor of my class does use up 104k, but the destructor only releases about 82k.

I copied the sources for my class to a new project and investigated the problem with Purify, and Purify tells me that there is a potentially memory leak of 16834 in one block allocated at the line
if(PdhAddCounter(m_hQuery,szCounterLine,0,&m_hCounter) != ERROR_SUCCESS)
and a memory leak of 2 blocks (I think that's for the 2 counters I monitor) for 314 bytes in the same line.

The help files of Visual C++ tell me that PdhCloseQuery(m_hQuery), which is called in the destructor, should free all resources belonging to the query and its contained counters, but even adding a loop with PdhRemoveCounter to remove the Counters (and freeing their memory) manually doesn't help. Purify still tells me of an potential memory leak of 16834 bytes in that line.

Now my question: what is causing this big amount of memory allocated at PdhAddCounter? I would have thought, that, if there's such a big amount associated to PdhQuery, it would be allocated at PdhOpenQuery. And how can this big memory block be freed again?

Hope anyone can help
Martin Dietz
Questionhow to... Pin
Bravoone_200619-Oct-06 21:01
Bravoone_200619-Oct-06 21:01 
AnswerRe: how to... Pin
Hamid_RT20-Oct-06 0:09
Hamid_RT20-Oct-06 0:09 
AnswerRe: how to... Pin
David Crow20-Oct-06 3:35
David Crow20-Oct-06 3:35 
QuestionWaitForSingleObject Pin
LiYS19-Oct-06 20:20
LiYS19-Oct-06 20:20 
AnswerRe: WaitForSingleObject Pin
Cedric Moonen19-Oct-06 20:38
Cedric Moonen19-Oct-06 20:38 
GeneralRe: WaitForSingleObject Pin
LiYS19-Oct-06 20:52
LiYS19-Oct-06 20:52 
GeneralRe: WaitForSingleObject Pin
Cedric Moonen19-Oct-06 20:59
Cedric Moonen19-Oct-06 20:59 
GeneralRe: WaitForSingleObject Pin
LiYS19-Oct-06 21:17
LiYS19-Oct-06 21:17 
GeneralRe: WaitForSingleObject Pin
Cedric Moonen19-Oct-06 22:31
Cedric Moonen19-Oct-06 22:31 
Questionhow to resolve this issue? Pin
gentleguy19-Oct-06 20:13
gentleguy19-Oct-06 20:13 
AnswerRe: how to resolve this issue? Pin
ThatsAlok19-Oct-06 20:19
ThatsAlok19-Oct-06 20:19 
AnswerRe: how to resolve this issue? Pin
Cedric Moonen19-Oct-06 20:29
Cedric Moonen19-Oct-06 20:29 
AnswerRe: how to resolve this issue? Pin
David Crow20-Oct-06 3:40
David Crow20-Oct-06 3:40 
QuestionTwo Joystick and DirectInput Pin
akira3219-Oct-06 18:33
akira3219-Oct-06 18:33 
Questionis this the only way to do OLEDB coonection Pin
With_problem19-Oct-06 16:36
With_problem19-Oct-06 16:36 
AnswerRe: is this the only way to do OLEDB coonection Pin
Mark Salsbery19-Oct-06 17:55
Mark Salsbery19-Oct-06 17:55 
Question[question] Inheritance and access level Pin
w2520n252019-Oct-06 16:24
w2520n252019-Oct-06 16:24 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.