TestFile does not delete the file when it is not useful anymore
Milian Wolff
mail at milianw.de
Tue Jun 24 11:09:25 UTC 2014
On Monday 23 June 2014 20:36:15 Denis Steckelmacher wrote:
> Hi,
>
> The QML/JS plugin imports in each file all the files in the same
> directory. This way, custom QML modules and global Javascript variables
> and functions are accessible from everywhere.
>
> The code-completion unit tests of the plugin use TestFiles, that are all
> created in the same directory. This causes problems because each test
> can see all the ones that were launched previously. Declarations are
> therefore duplicated or appear when they shouldn't.
>
> I currently see two solutions for this problem:
>
> * Modifying the unit test so that every symbol is unique (this way, the
> fact that every file sees the others is not a problem anymore)
> * Deleting the test file as soon as possible (for instance just after
> having parsed and added it to the DUChain)
>
> What is your preferred solution? The first one involves changing the
> test code, the second one requires changes in KDevPlatform and could be
> more invasive.
The TestFile does remove its data from the DUChain when it is destroyed. So
what you describe above sounds as if the TestFiles are leaked? If so, then
this is the problem. Which is odd, as the TestFile's are stored in a
QSharedPointer and should thus be freed properly, no?
So please debug this and ensure the TestFiles get deleted _and_ that the data
they created is removed from the DUChain at that point.
Bye
--
Milian Wolff
mail at milianw.de
http://milianw.de
More information about the KDevelop-devel
mailing list