Commit f124dab2 authored by Milian Wolff's avatar Milian Wolff
Browse files

Fix leaks in custom-definesandincludes test

Fixes LSAN report:
```

Indirect leak of 16 byte(s) in 1 object(s) allocated from:
    #0 0x7fcdeefc1f41 in operator new(unsigned long) /build/gcc/src/gcc/libsanitizer/asan/asan_new_delete.cpp:99
    #1 0x7fcdeec2ec62 in KDevelop::KDevSignalSpy::KDevSignalSpy(QObject*, char const*, Qt::ConnectionType) /home/milian/projects/kf5/src/extragear/kdevelop/kdevelop/kdevplatform/tests/kdevsignalspy.cpp:34
    #2 0x55f03429e6a2 in loadProject /home/milian/projects/kf5/src/extragear/kdevelop/kdevelop/plugins/custom-definesandincludes/tests/projectsgenerator.cpp:44
```
parent dbcb2ea3
......@@ -41,10 +41,10 @@ namespace
/// @param projectFile projectName.kdev4 file
IProject* loadProject( const QString& projectFile, const QString& projectName )
{
auto* projectSpy = new KDevSignalSpy( ICore::self()->projectController(), SIGNAL(projectOpened(KDevelop::IProject*)) );
KDevSignalSpy projectSpy(ICore::self()->projectController(), SIGNAL(projectOpened(KDevelop::IProject*)));
ICore::self()->projectController()->openProject( QUrl::fromLocalFile(projectFile) );
if( !projectSpy->wait( 5000 ) ) {
if (!projectSpy.wait(5000)) {
qFatal("Expected project to be loaded within 5 seconds, but this didn't happen");
}
IProject* project = ICore::self()->projectController()->findProjectByName( projectName );
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment