Results 1 to 2 of 2

Thread: C++ what happens when don't delete an object?

  1. #1
    Join Date
    May 2007
    Location
    USA
    Posts
    373
    Thanks
    2
    Thanked 4 Times in 4 Posts

    Default C++ what happens when don't delete an object?

    What happens when you forget to delete an object in C++ and the program terminates? I assume the memory is freed, but I don't know.
    Trinithis

  2. #2
    Join Date
    Aug 2007
    Location
    Somewhere in the vicinity of Betelgeuse
    Posts
    23
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    It depends on the OS and the C lib being used. In most cases, with modern OS's your memory will be freed, but with some older OS's it may not. Certainly, while your app is running the memory will not be freed and, depending on how much you use, you could cause an OS crash.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •