Skip to content

Commit

Permalink
silence newDelete leaks warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
Waqar144 committed Nov 24, 2023
1 parent 4ad8242 commit aa5ec98
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
12 changes: 4 additions & 8 deletions probe/hooks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,8 @@ static void gammaray_pre_routine()
if (qApp) // DllMain will do a better job at this, we are too early here and might not even have our staticMetaObject properly resolved
return;
#endif
// NOLINTNEXTLINE(clang-analyzer-cplusplus.NewDeleteLeaks)
new ProbeCreator(ProbeCreator::Create | ProbeCreator::FindExistingObjects);
}
} // NOLINT(clang-analyzer-cplusplus.NewDeleteLeaks)
Q_COREAPP_STARTUP_FUNCTION(gammaray_pre_routine)

// previously installed Qt hooks, for daisy-chaining
Expand All @@ -70,12 +69,11 @@ static void (*gammaray_next_removeObject)(QObject *) = nullptr;
extern "C" Q_DECL_EXPORT void gammaray_startup_hook()
{
Probe::startupHookReceived();
// NOLINTNEXTLINE(clang-analyzer-cplusplus.NewDeleteLeaks)
new ProbeCreator(ProbeCreator::Create);

if (gammaray_next_startup_hook)
gammaray_next_startup_hook();
}
} // NOLINT(clang-analyzer-cplusplus.NewDeleteLeaks)

extern "C" Q_DECL_EXPORT void gammaray_addObject(QObject *obj)
{
Expand Down Expand Up @@ -127,19 +125,17 @@ extern "C" Q_DECL_EXPORT void gammaray_probe_inject()
}
Hooks::installHooks();
log_injection("gammaray_probe_inject()\n");
// NOLINTNEXTLINE(clang-analyzer-cplusplus.NewDeleteLeaks)
new ProbeCreator(ProbeCreator::Create | ProbeCreator::FindExistingObjects);
}
} // NOLINT(clang-analyzer-cplusplus.NewDeleteLeaks)

extern "C" Q_DECL_EXPORT void gammaray_probe_attach()
{
if (!qApp) {
return;
}
log_injection("gammaray_probe_attach()\n");
// NOLINTNEXTLINE(clang-analyzer-cplusplus.NewDeleteLeaks)
new ProbeCreator(ProbeCreator::Create | ProbeCreator::FindExistingObjects | ProbeCreator::ResendServerAddress);
}
} // NOLINT(clang-analyzer-cplusplus.NewDeleteLeaks)

extern "C" Q_DECL_EXPORT void gammaray_install_hooks()
{
Expand Down
2 changes: 1 addition & 1 deletion tests/signalspycallbacktest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ private slots:

delete s1.data();
delete s2.data();
}
} // NOLINT(clang-analyzer-cplusplus.NewDeleteLeaks)

static void cleanupTestCase()
{
Expand Down

0 comments on commit aa5ec98

Please sign in to comment.