flat assembler
Message board for the users of flat assembler.

Index > Windows > memory leakage

Author
Thread Post new topic Reply to topic
archieb



Joined: 11 Aug 2005
Posts: 2
Location: Philippines
archieb
Question 1:
invoke CreateFile,...
mov [hFileR],eax
invoke CreateFileMapping,...
mov [hFileM],eax

In the code above, if I did not close it with
invoke CloseHandle,[hFileR]
invoke CloseHandle,[hFileM]
will it cause a memory leak on a windows 9x?

Question 2: Is it true that memory leaks like this will not happen on
a Windows 2000/XP system?

Question 3: What if a program hangs, will that cause memory leaks?
Post 11 Aug 2005, 18:24
View user's profile Send private message Reply with quote
RedGhost



Joined: 18 May 2005
Posts: 443
Location: BC, Canada
RedGhost
the memory leak comes from the fact you have an open handle in memory and you have not closed it, i have had memory leaks on winxp because of unclosed handles to CreateToolhelp32Snapshot, so i assume it is required on xp, i can't see why it wouldn't be on 9x, but i have no current 9x os running that i could test on
Post 11 Aug 2005, 23:43
View user's profile Send private message AIM Address MSN Messenger Reply with quote
Raedwulf



Joined: 13 Jul 2005
Posts: 375
Location: United Kingdom
Raedwulf
It should cause a memory on win9x....win9x is notorious for its handling of memory leaks - that's why I always needed to reboot so often Razz.
In WinXP the memory leak will still occur but you can get away with it because winxp handles things safer so at most you close the app and everything is back to normal. (almost, hopefully Very Happy)
But I'm not suggesting you to remove CloseHandle because if you don't weird things can happen. Razz So it is a REQUIREMENT Smile
Post 12 Aug 2005, 06:47
View user's profile Send private message MSN Messenger Reply with quote
Raedwulf



Joined: 13 Jul 2005
Posts: 375
Location: United Kingdom
Raedwulf
If a program hangs there is a possibility there will be memory leaks......but why would you want your program to hang ? Very Happy
Post 12 Aug 2005, 06:48
View user's profile Send private message MSN Messenger Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
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


Copyright © 1999-2020, Tomasz Grysztar. Also on GitHub, YouTube, Twitter.

Website powered by rwasa.