Question: Should the background parser delete ParseJobs?

Milian Wolff mail at milianw.de
Mon Nov 2 17:46:30 UTC 2009


On Monday, 2. November 2009 18:17:34 Milian Wolff wrote:
> On Sunday, 1. November 2009 23:40:13 David Nolden wrote:
> > Am Samstag 31 Oktober 2009 16:12:48 schrieb Milian Wolff:
> > > Hi there!
> > >
> > > In ~BackgroundParserPrivate() the ParseJob gets deleted, but I wonder
> > > why? I mean they are owned by the LanguagePlugin, no? Shouldn't they
> > > delete the jobs?
> >
> > Who says they are owned by the language plugin? Usually they are deleted
> > by BackgroundParser::parseComplete, so the background-parser owns them.
> 
> OK, just rechecked with CPP and it doesn't set a parent for the Parsejob,
> while PHP still does. Will change it.

Thinking about it - should we not also remove this stuff from 
language/parsejob.h/.cpp ? I can commit this, also affects CPPParseJob as it 
initilizes KDevelop::ParseJob(url, 0).

> Should we add job->setParent(this) in
> BackgroundParserPrivate::parseDocumentsInternal ? Would potentially save us
> some code in the dtor, but only if we don't to set
>             it.value()->setBackgroundParser(0);

setParent(this) won't work since BackgroundParserPrivate is not a QObject.

-- 
Milian Wolff
mail at milianw.de
http://milianw.de
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kdevelop-devel/attachments/20091102/a1903df4/attachment.sig>


More information about the KDevelop-devel mailing list