Click here to Skip to main content
15,916,019 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: .NET and COM Pin
Rajesh R Subramanian22-Dec-09 6:50
professionalRajesh R Subramanian22-Dec-09 6:50 
GeneralRe: .NET and COM Pin
Maximilien22-Dec-09 7:42
Maximilien22-Dec-09 7:42 
GeneralRe: .NET and COM PinPopular
Rajesh R Subramanian22-Dec-09 7:46
professionalRajesh R Subramanian22-Dec-09 7:46 
QuestionLife span of a Object???? Pin
ForNow22-Dec-09 4:29
ForNow22-Dec-09 4:29 
AnswerRe: Life span of a Object???? Pin
Maximilien22-Dec-09 4:37
Maximilien22-Dec-09 4:37 
GeneralRe: Life span of a Object???? Pin
ForNow22-Dec-09 5:44
ForNow22-Dec-09 5:44 
AnswerRe: Life span of a Object???? Pin
Rajesh R Subramanian22-Dec-09 4:45
professionalRajesh R Subramanian22-Dec-09 4:45 
GeneralRe: Life span of a Object???? Pin
LunaticFringe22-Dec-09 5:27
LunaticFringe22-Dec-09 5:27 
Rajesh R Subramanian wrote:
Yes, if you create an object on the heap, it will remain until you clear it off manually (I mean - by using delete if created with new or with free if created with malloc).


An addendum, if I may...

If you create an object on the heap, it'll remain there until you clean it up... or the process under which it was allocated is terminated, at which point it'll be cleaned up by the OS.

The critical point to understand is this. If you allocate memory once in the course of your program and don't delete (or free, whichever is appropriate) it, it's not a big deal - the OS will clean it up. You get into trouble when you allocate blocks repeatedly and don't free (or delete) them. It's true that the OS will still clean it all up when the process terminates, but the longer the process runs the more memory it 'leaks', with detrimental effect on the whole system for the duration of the process' lifetime. This is why it's considered to be good form to always free any memory you've allocated.

L u n a t i c F r i n g e

GeneralRe: Life span of a Object???? Pin
Rajesh R Subramanian22-Dec-09 6:02
professionalRajesh R Subramanian22-Dec-09 6:02 
GeneralRe: Life span of a Object???? Pin
LunaticFringe22-Dec-09 6:14
LunaticFringe22-Dec-09 6:14 
AnswerRe: Life span of a Object???? [modified] Pin
Nelek22-Dec-09 4:48
protectorNelek22-Dec-09 4:48 
GeneralRe: Life span of a Object???? Pin
Rajesh R Subramanian22-Dec-09 5:14
professionalRajesh R Subramanian22-Dec-09 5:14 
GeneralRe: Life span of a Object???? Pin
Nelek22-Dec-09 8:04
protectorNelek22-Dec-09 8:04 
GeneralRe: Life span of a Object???? Pin
Rajesh R Subramanian22-Dec-09 18:49
professionalRajesh R Subramanian22-Dec-09 18:49 
QuestionStack corruption - STRANGE PROBLEM!! Pin
Shailesh H22-Dec-09 3:44
Shailesh H22-Dec-09 3:44 
AnswerRe: Stack corruption - STRANGE PROBLEM!! Pin
Shailesh H22-Dec-09 4:07
Shailesh H22-Dec-09 4:07 
GeneralRe: Stack corruption - STRANGE PROBLEM!! [modified] Pin
Code-o-mat22-Dec-09 4:30
Code-o-mat22-Dec-09 4:30 
AnswerRe: Stack corruption - STRANGE PROBLEM!! Pin
Rajesh R Subramanian22-Dec-09 4:42
professionalRajesh R Subramanian22-Dec-09 4:42 
AnswerRe: Stack corruption - STRANGE PROBLEM!! Pin
Maximilien22-Dec-09 4:11
Maximilien22-Dec-09 4:11 
QuestionRe: Stack corruption - STRANGE PROBLEM!! Pin
Nelek22-Dec-09 4:17
protectorNelek22-Dec-09 4:17 
QuestionRe: Stack corruption - STRANGE PROBLEM!! Pin
22491722-Dec-09 13:31
22491722-Dec-09 13:31 
QuestionNot able to sniff TCP packet on windows Vista. But could do so on XP Pin
Aseem Sharma22-Dec-09 1:08
Aseem Sharma22-Dec-09 1:08 
QuestionRe: Not able to sniff TCP packet on windows Vista. But could do so on XP Pin
CPallini22-Dec-09 1:34
mveCPallini22-Dec-09 1:34 
AnswerRe: Not able to sniff TCP packet on windows Vista. But could do so on XP Pin
Aseem Sharma22-Dec-09 20:16
Aseem Sharma22-Dec-09 20:16 
QuestionUnable to start the windows service in Windows server 2003 Pin
Arun Abraham Jose22-Dec-09 0:13
Arun Abraham Jose22-Dec-09 0:13 

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.