[PATCH] shared dpointer for duchain
Andreas Pakulat
apaku at gmx.de
Sun Dec 16 18:23:11 UTC 2007
On 16.12.07 18:49:47, David Nolden wrote:
> On Saturday 15 December 2007 21:55:11 Andreas Pakulat wrote:
> > Hi,
> >
> > apparently our list doesn't like mails larger than 20K (the first
> > version of this had an 18K attachment), so this time with a link instead
> > of attached patch.
> >
> > I've started on the shared-dpointer stuff and so far made Declaration,
> > DUChainBase and FunctionDeclaration. It compiles and kdevelop still
> > starts. Unfortunately I hit a crash inside ~DocumentRangeObject. Looking
> > at some debug output I've inserted locally it seems like there exist two
> > document range objects that own the same range (pointer-wise) and when
> > the second DocumentRangeObject gets deleted
> > KTextEditor::Range::isSmartRange simply crashes.
> >
> > I don't see any changes from me that would create a DUChain item with
> > the same range as an existing item, but I may be overlooking something.
> > Thus I post the patches here, so somebody with more inside into this
> > stuff can have a look and give me a hint or two.
> >
> > The patch can be found at:
> > http://www.apaku.de/vardata/kdevplatform_shared_dpointer.diff
>
> I haven't looked at the patch yet(had no time), but to me this clearly sounds
> like a problem in the clone() implementation.
Aaah, thanks that brought me onto the right track. The copy constructor
for FunctionDeclaration called the Declaration constructor with proper
values for the url and textrange and thus the resulting object owned the
range.
I still have a crash, but it seems to happen earlier now :)
Andreas
--
Your fly might be open (but don't check it just now).
More information about the KDevelop-devel
mailing list