| ||||
| Comment on (V)C++ recorded talks at VS 2013 Launch by nosenseetal
Herb this is offtopic, but regarding memory leak in your fav 10 liner… Also I know you probably hate to comment on quality of MS code but do you have opinion is this an ok modern C++ code or it could be done cleaner: if (–m_refs == 0) from : https://casablanca.codeplex.com/SourceControl/latest#Release/src/http/listener/http_linux_server.cpp Comment on (V)C++ recorded talks at VS 2013 Launch by Herb Sutter
@nosenseetal: I’m not sure a circular buffer would be ideal — we don’t want to lose weak_ptrs while there are outstanding shared_ptrs and the number of outstanding live objects is not known in advance. As for ‘delete this;’, it is overused and dangerous in the wrong hands, but it can be appropriate for an object that controls its own lifetime and you know you won’t have pointers or references to it. In this case, just from the snippet you provided you can see the object is probably using intrusive reference counting and just implementing it by hand. I might prefer using standard smart pointers instead of reimplementing it by hand, possibly including using enable_shared_from_this if appropriate, but I haven’t inspected the code. Read More » | ||||
| | ||||
| ||||
Monday, November 18, 2013
FeedaMail: Comments for Sutterâs Mill
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment