Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


[Question]about memory leak when closehandle

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
leovn
How do I cheat?
Reputation: 0

Joined: 30 May 2006
Posts: 4

PostPosted: Thu Jul 02, 2009 2:58 am    Post subject: [Question]about memory leak when closehandle Reply with quote

I want to ask something about CloseHandle and OpenProcess

When i use OpenProcess the first time to do something (read memory in another process) then i'm not CloseHandle it

I continue using OpenProcess to open another handle to this target process (same as above), this time i use CloseHandle to close it, and do something again, finally i use CloseHandle to close the handle i open at first.

Does it make memory leak for my target process ?

My code looks like:

hProc = OpenProcess(PROCESS_ALL_ACCESS, false, dwProcID)
readmemory(xyz);
dosomething(abc);

hProc1 = OpenProcess(PROCESS_ALL_ACCESS, false, dwProcID)
dosomething(def);
CloseHandle(hProc1);

dosomething(ghi);
CloseHandle(hProc);

Memory leak?
Back to top
View user's profile Send private message
hcavolsdsadgadsg
I'm a spammer
Reputation: 26

Joined: 11 Jun 2007
Posts: 5801

PostPosted: Thu Jul 02, 2009 3:12 am    Post subject: Reply with quote

should be fine.
Back to top
View user's profile Send private message
leovn
How do I cheat?
Reputation: 0

Joined: 30 May 2006
Posts: 4

PostPosted: Thu Jul 02, 2009 4:53 am    Post subject: Reply with quote

Thank you so much
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites