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

List:       kde-panel-devel
Subject:    Re: [PATCH] RunnerManager
From:       "Aaron J. Seigo" <aseigo () kde ! org>
Date:       2008-04-24 13:54:12
Message-ID: 200804240801.47615.aseigo () kde ! org
[Download RAW message or body]

[Attachment #2 (multipart/signed)]


On Thursday 24 April 2008, Jordi Polo wrote:
> There must be some usage of that constructor I am not taking into account
> because as I see it is only used to create localcontext, and work with
> them.

it probably is only used currently to create local contexts, but the 
implementation should not work under that assumption since the behaviour is 
not limited to it.

> But the global context that is the one used by interface also, never 
> gets destroyed.

it's not the global context that matters. when the local context goes out of 
scope, the d ptr is delete and then we have this:

        ~Private()
        {
            qDeleteAll(matches);
            matches.clear();
            delete completer;
        }

so the completer, which is still referenced by other local contexts and the 
global one, gets deleted leaving dangling pointers. the next local context 
that gets destroyed will end up doubly deleting completer. *boom*

> In fact, if d is going to be QExplicitlySharedDataPointer'd is not the same
> that just let everyone use the same globalContext and kill the localContext
> idea ?

the global context may be changing in the main UI. by having a local context 
we avoid race conditions where matches get registered that no longer actually 
match the query being added as if they did.

(and looking further, we may do just fine with QSharedDataPointer, even)

-- 
Aaron J. Seigo
humru othro a kohnu se
GPG Fingerprint: 8B8B 2209 0C6F 7C47 B1EA  EE75 D6B7 2EB1 A7F1 DB43

KDE core developer sponsored by Trolltech

["signature.asc" (application/pgp-signature)]

_______________________________________________
Panel-devel mailing list
Panel-devel@kde.org
https://mail.kde.org/mailman/listinfo/panel-devel


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

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