Jon S. Berndt a écrit :
>> [hundreds of lines of grep output omitted]
>>
>> I know for a fact that many of those allocations and assignments use
>> smart pointers. How about a more useful list of those that don't?
>>
>> Thanks in advance,
>> Tim
>>     
>
> And some others appear to me to be properly used.
>
> I'm perplexed by the previous comment stating: "we want to avoid writing
> explicit deletes as much as possible, as that need is the source of most
> memory leaks."
>
> Where there is a new, there is a delete. What am I missing in the above
> comment? I can see memory leaks being caused by NOT delete-ing memory that
> was allocated by a previous "new".
>
> Jon
>   

Hi Jon,

the good practise is to give the result of the new operator to smart or
auto pointer objects that would do the delete job automatically and
rigorously, even in the presence of exceptions. See the std::auto_ptr<>
class template for example.

-Fred

-- 
Frédéric Bouvier
http://my.fotolia.com/frfoto/   Photo gallery
http://fgsd.sourceforge.net/    FlightGear Scenery Designer


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel

Reply via email to