[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    Re: branches/KDE/4.0/kdelibs/khtml/ecma
From:       David Faure <faure () kde ! org>
Date:       2008-01-20 22:43:34
Message-ID: 200801202343.35220.faure () kde ! org
[Download RAW message or body]

On Saturday 19 January 2008, Maks Orlovich wrote:
> +    static HashMap<void*, DOMObject*>* s_allDomObjects;
> +    static HashMap<void*, DOMObject*>* allDomObjects() {
> +        if (!s_allDomObjects)
> +            s_allDomObjects = new HashMap<void*, DOMObject*>();
> +        return s_allDomObjects;
> +    }
> +    

s_allDomObjects is leaked at end of process (showing up when running memcheck), no?
I suggest K_GLOBAL_STATIC, which would also simplify the above code.

-- 
David Faure, faure@kde.org, sponsored by Trolltech to work on KDE,
Konqueror (http://www.konqueror.org), and KOffice (http://www.koffice.org).

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic