diff --git a/examples/facebookdemo/main.cpp b/examples/facebookdemo/main.cpp index 7aa9f12..ea0e580 100644 --- a/examples/facebookdemo/main.cpp +++ b/examples/facebookdemo/main.cpp @@ -67,7 +67,10 @@ int main(int argc, char *argv[]) { QCoreApplication::setOrganizationDomain("mysoft.com"); QCoreApplication::setApplicationName("facebookdemo"); Helper helper; +// Suppress warning: Potential leak of memory in qtimer.h [clang-analyzer-cplusplus.NewDeleteLeaks] +#ifndef __clang_analyzer__ QTimer::singleShot(0, &helper, &Helper::processArgs); +#endif return a.exec(); } diff --git a/examples/msgraphdemo/main.cpp b/examples/msgraphdemo/main.cpp index 6c449fb..6a8df6b 100644 --- a/examples/msgraphdemo/main.cpp +++ b/examples/msgraphdemo/main.cpp @@ -59,7 +59,10 @@ int main(int argc, char *argv[]) { QCoreApplication::setOrganizationName("O2"); QCoreApplication::setApplicationName("Msgraph Example"); Helper helper; +// Suppress warning: Potential leak of memory in qtimer.h [clang-analyzer-cplusplus.NewDeleteLeaks] +#ifndef __clang_analyzer__ QTimer::singleShot(0, &helper, &Helper::run); +#endif return a.exec(); } diff --git a/examples/msgraphexternalinterceptordemo/main.cpp b/examples/msgraphexternalinterceptordemo/main.cpp index 1a93cc5..d0e9ad0 100644 --- a/examples/msgraphexternalinterceptordemo/main.cpp +++ b/examples/msgraphexternalinterceptordemo/main.cpp @@ -57,7 +57,10 @@ int main(int argc, char *argv[]) { QCoreApplication::setOrganizationName("O2"); QCoreApplication::setApplicationName("Msgraph Example"); Helper helper; +// Suppress warning: Potential leak of memory in qtimer.h [clang-analyzer-cplusplus.NewDeleteLeaks] +#ifndef __clang_analyzer__ QTimer::singleShot(0, &helper, &Helper::run); +#endif return a.exec(); } diff --git a/examples/msgraphexternalinterceptordemo/webwindow.cpp b/examples/msgraphexternalinterceptordemo/webwindow.cpp index 629ad1f..58db840 100644 --- a/examples/msgraphexternalinterceptordemo/webwindow.cpp +++ b/examples/msgraphexternalinterceptordemo/webwindow.cpp @@ -66,7 +66,10 @@ void WebWindow::closeEvent(QCloseEvent *) void WebWindow::onCallbackCatched(const QString &inURLString) { mCatchedOAuthURL = inURLString; +// Suppress warning: Potential leak of memory in qtimer.h [clang-analyzer-cplusplus.NewDeleteLeaks] +#ifndef __clang_analyzer__ QTimer::singleShot(100, this, &WebWindow::onCallbackCatchedSafe); +#endif } void WebWindow::onCallbackCatchedSafe() diff --git a/examples/twitterdemo/main.cpp b/examples/twitterdemo/main.cpp index 659d30f..fbd1b2b 100644 --- a/examples/twitterdemo/main.cpp +++ b/examples/twitterdemo/main.cpp @@ -105,8 +105,10 @@ int main(int argc, char *argv[]) { QCoreApplication::setOrganizationDomain("mysoft.com"); QCoreApplication::setApplicationName("tweeter"); Helper helper; +// Suppress warning: Potential leak of memory in qtimer.h [clang-analyzer-cplusplus.NewDeleteLeaks] +#ifndef __clang_analyzer__ QTimer::singleShot(0, &helper, &Helper::processArgs); - +#endif return a.exec(); } diff --git a/examples/vimeodemo/main.cpp b/examples/vimeodemo/main.cpp index e341ed7..eb42760 100644 --- a/examples/vimeodemo/main.cpp +++ b/examples/vimeodemo/main.cpp @@ -57,7 +57,10 @@ int main(int argc, char *argv[]) { QCoreApplication::setOrganizationName("O2"); QCoreApplication::setApplicationName("Vimeo Test"); Helper helper; +// Suppress warning: Potential leak of memory in qtimer.h [clang-analyzer-cplusplus.NewDeleteLeaks] +#ifndef __clang_analyzer__ QTimer::singleShot(0, &helper, &Helper::run); +#endif return a.exec(); } diff --git a/examples/youtubedemo/main.cpp b/examples/youtubedemo/main.cpp index e749134..508b051 100644 --- a/examples/youtubedemo/main.cpp +++ b/examples/youtubedemo/main.cpp @@ -54,7 +54,10 @@ int main(int argc, char *argv[]) { QCoreApplication::setOrganizationName("O2"); QCoreApplication::setApplicationName("YouTube Test"); Helper helper; +// Suppress warning: Potential leak of memory in qtimer.h [clang-analyzer-cplusplus.NewDeleteLeaks] +#ifndef __clang_analyzer__ QTimer::singleShot(0, &helper, &Helper::run); +#endif return a.exec(); } diff --git a/src/o2requestor.cpp b/src/o2requestor.cpp index 31b63e7..84acd25 100644 --- a/src/o2requestor.cpp +++ b/src/o2requestor.cpp @@ -269,9 +269,12 @@ void O2Requestor::onRequestFinished() { if (reply_ != qobject_cast(sender())) { return; } +// Suppress warning: Potential leak of memory in qtimer.h [clang-analyzer-cplusplus.NewDeleteLeaks] +#ifndef __clang_analyzer__ if (reply_->error() == QNetworkReply::NoError) { QTimer::singleShot(10, this, &O2Requestor::finish); } +#endif } void O2Requestor::onRequestError(QNetworkReply::NetworkError error) { @@ -292,7 +295,10 @@ void O2Requestor::onRequestError(QNetworkReply::NetworkError error) { O0BaseAuth::log( QStringLiteral( "O2Requestor::onRequestError: Invoking remote refresh failed" ), O0BaseAuth::LogLevel::Critical ); } error_ = error; +// Suppress warning: Potential leak of memory in qtimer.h [clang-analyzer-cplusplus.NewDeleteLeaks] +#ifndef __clang_analyzer__ QTimer::singleShot(10, this, &O2Requestor::finish); +#endif } void O2Requestor::onUploadProgress(qint64 uploaded, qint64 total) {