The Daily Static
  The Daily Static
UF Archives
Register
UF Membership
Ad Free Site
Postcards
Community

Geekfinder
UFie Gear
Advertise on UF

Forum Rules
& FAQ


Username

Password


Create a New Account

 
 

Back to UserFriendly Strip Comments Index

Memory leak in C++ Code - help needed! by perpeduumimmobl2005-10-06 07:48:23
  Okay, I wrote my own memory use tool. by williamashbless 2005-10-06 09:40:53
(overloaded operator new, new[], delete, and delete[], don'tcha know, and kept track of things).

Result: No memory leak.

There may be a memory leak in code outside of this function, or there may be a bug inside the string or string stream classes.

But that function is safe, as far as I can tell. (I did a float, double and int conversion).

(Arguably, for speed purposes, you could avoid doing a 'new' of the istringstream, and just put it on the stack as a local, but internally, it's probably doing 'new's itself).


[ Reply ]
    (which isn't to say I'm right, but my first stab by williamashbless2005-10-06 09:42:47

 

[Todays Cartoon Discussion] [News Index]

Come get yer ARS (Account Registration System) Source Code here!
All images, characters, content and text are copyrighted and trademarks of J.D. Frazer except where other ownership applies. Don't do bad things, we have lawyers.
UserFriendly.Org and its operators are not liable for comments or content posted by its visitors, and will cheerfully assist the lawful authorities in hunting down script-kiddies, spammers and other net scum. And if you're really bad, we'll call your mom. (We're not kidding, we've done it before.)