On Thursday 25 July 2013 13:50:26 Thomas Lübking wrote:
> On Donnerstag, 25. Juli 2013 11:53:20 CEST, Pali Rohár wrote:
> > In our case (in Trojita), we have
> > KGlobal::hasMainComponent()
> 
> What sets KGlobal::newComponentData() and why does it pass a
> junk name? I'd suggest to fix that.
> (The KComponentData constructors do so, when passed
> RegisterAsMainComponent)
> 

It looks like that shared kde4 kabc library which is linked to 
kde addressbook trojita plugin (which was loaded before kwallet 
plugin). Order of loading trojita plugins is now undefined. And I 
do not want to have some linear ordering for loading plugins...

> > What other developers think?
> 
> The code is safe and will work - at the moment.
> 
> In general I would however resist from const casting
> non-internal stuff (the "I wrote that and I know what I do
> here" case) if any avoidable, eg. KGlobal::mainComponent()
> could all out of a sudden return a(n implicitly shared)
> temporary (though signature changing is not ABI stable, the
> temporary could also be drawn internally)
> 
> Your code would still compile and operate w/o crashing - just
> not do what you expect it to do.
> 
> Cheers,
> Thomas

This my change only set program name only if current name is 
empty.

-- 
Pali Rohár
[email protected]

Attachment: signature.asc
Description: This is a digitally signed message part.

Reply via email to