Updated class browser

Lior Mualem lior.m.kde at gmail.com
Thu Apr 2 09:00:25 UTC 2009


On Thu, Apr 2, 2009 at 9:48 AM, David Nolden
<david.nolden.kdevelop at art-master.de> wrote:
> Am Donnerstag 02 April 2009 03:37:54 schrieb Hamish Rodda:
>> On Thursday 02 April 2009 10:18:03 Lior Mualem wrote:
>> > I'm probably using the DUChains wrong but I have no idea why. Do I need
>> > to delete myself the declarations that I retrieve from the DUChains? I
>> > don't recall seeing any mentioning for this in the documentation (except
>> > the usage of a DUChainPointer which I use).
>>
>> Don't know, perhaps David has an idea.
> To me, this looks like you have deleted an object that belongs to the duchain,
> specifically a KDevelop::ParsingEnvironmentFile, which is something you should
> never do. You should never delete any duchain objects.

I assume that I misused the smart pointers - I thought that when I get
a " Declaration* " I could directly assign it to a DUChainPointer but
now I see that maybe I should use the weakPointer() function to
retrieve a smart pointer for it.

Now even if I don't hold any smart pointer, I still have these errors
when the program terminates:
FunctionDeclarationData::m_defaultParameters There were items left on
destruction: 7
ClassFunctionDeclarationData::m_defaultParameters There were items
left on destruction: 15
SpecialTemplateDeclarationData::m_specializations There were items
left on destruction: 3
ClassDeclarationData::baseClasses There were items left on destruction: 5
TopDUContextData::m_usedDeclarationIds There were items left on destruction: 157
DUContextData::m_importedContexts There were items left on destruction: 209
DUContextData::m_childContexts There were items left on destruction: 209
DUContextData::m_importers There were items left on destruction: 209
DUContextData::m_localDeclarations There were items left on destruction: 209
DUContextData::m_uses There were items left on destruction: 209

but it also happens when I completely disable the class browser so I
assume it's not me.


>
>> > 2. I'm not sure how to monitor class changes efficiently (to reflect
>> > changes in list of functions / variables) - I'm using DUChainObserver
>> > retrieved from DUChain::self()->notifier(), I then connect to the
>> > branchModified signal. The problem with that is that I get 2
>> > notifications for each change: 1. The context range for the first call is
>> > the entire document (by querying the range() function).
>> >   2. The context range for te second call is zero start and end lines.
>> > It doesn't matter what I change in the document, class level, function
>> > level, document level - the results are the same.
>> >
>> > Now - I could use this notification and then do the extra work and update
>> > all the classes that relate to the document but Isn't it suppose to
>> > notify my on a child context changes (for example the class declaration
>> > level context)? or am I missing something here?
>>
>> We once had it that every duchain change was notified, but that was a huge
>> performance hit.  Now we just have the branch, and for the moment it just
>> reports a change to the whole chain rather than the specifics that changed.
>>
>> So yes, you have to update all classes that relate to the document.  The
>> old code had this, if you want to study it to find out how.
>
> Yes, you should just wait for a document update, and then just consider
> everything within that document as changed.

OK, that's what I thought of doing. I just hoped that there was an easier way.

>
> Greetings, david
>
>
> _______________________________________________
> KDevelop-devel mailing list
> KDevelop-devel at kdevelop.org
> https://barney.cs.uni-potsdam.de/mailman/listinfo/kdevelop-devel
>




More information about the KDevelop-devel mailing list