[patch] Looking for an opinion on std::auto_ptr

Erik Hovland erik at hovland.org
Mon Oct 20 19:02:12 CEST 2008


I am a sucker for std::auto_ptr. Since I know of my weakness, I wanted to check
the temperature of the rest of the developers. Mainly because auto_ptr
is not yet
used.

Anyhow, the attached patch does two things. The first is that the first call to
delete ec is never executed if ec is valid. That is a minor memory leak since
it seems as() does dynamically allocate that pointer.

Secondly, it seems auto_ptr could be used for all of the foreach calls in that
function.

If no one complains in the next 48 hours I will likely commit this
patch. If there are
concerns, I am happy to address them.

Thanks

E

-- 
Erik Hovland
erik at hovland.org
http://hovland.org/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: deadcode-plus-auto_ptr.patch
Type: text/x-diff
Size: 5039 bytes
Desc: not available
Url : http://mail.kde.org/pipermail/amarok-devel/attachments/20081020/336b8e82/attachment.bin 


More information about the Amarok-devel mailing list