From 8dc91d640b5cf4648d057eb86864b88b0f411fd9 Mon Sep 17 00:00:00 2001 From: Matt Hardcastle Date: Tue, 5 Nov 2019 09:23:36 -0800 Subject: [PATCH] Remove `this` and connection from lambda expression Clang in Xcode 11 is more aggressive about its warnings. This resolves one of the issue Clang noticed in order to support building w/Xcode 11. I first attempted to remove `this` completes, but VS complained that `QObject::disconnect` was being called without `this`. This change satisfies both Clang and VS. A second attempt added this back and then called `disconnect` directly. This also generated a Clang warning. This version resolves the issue by removing the error handler. This also resolves a memory leak caused by the error handler. --- interface/src/AvatarBookmarks.cpp | 6 ------ 1 file changed, 6 deletions(-) diff --git a/interface/src/AvatarBookmarks.cpp b/interface/src/AvatarBookmarks.cpp index 2ebe769bec..6f6a93ff19 100644 --- a/interface/src/AvatarBookmarks.cpp +++ b/interface/src/AvatarBookmarks.cpp @@ -232,12 +232,6 @@ void AvatarBookmarks::loadBookmark(const QString& bookmarkName) { emit bookmarkLoaded(bookmarkName); }); - std::shared_ptr connection2 = std::make_shared(); - *connection2 = connect(myAvatar.get(), &MyAvatar::onLoadFailed, [this, bookmarkName, connection2]() { - qCDebug(interfaceapp) << "Failed to load avatar bookmark" << bookmarkName; - QObject::disconnect(*connection2); - }); - qCDebug(interfaceapp) << "Start loading avatar bookmark" << bookmarkName; const QString& avatarUrl = bookmark.value(ENTRY_AVATAR_URL, "").toString();