On Thu, Jan 7, 2010 at 1:43 PM, Jeremy Orlow <jor...@chromium.org> wrote:

> You ignored the second half of my suggestion.
>

The second half of your suggestion leaks memory.  When we have easy and
elegant ways to avoid memory leaks, it behooves us to use them.

It also seems like a poor idea to me to suggest that, potentially, any
function returning a string by reference might have to have its own memory
leak, or allocation code, or static object, if it needs to be able to return
an empty object.  Even if we could do that with no ill consequences, it
would be nice to avoid it.

After my patch, the total number of calls of these functions in the entire
codebase is something like 10 instances.  They're rare enough to be
invisible to most people and unusual otherwise.

PK
-- 
Chromium Developers mailing list: chromium-dev@googlegroups.com 
View archives, change email options, or unsubscribe: 
    http://groups.google.com/group/chromium-dev

Reply via email to