From a5b5a23bf2ba03ec6f64cd277c044aafa7e79189 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marco=20Trevisan=20=28Trevi=C3=B1o=29?= Date: Mon, 9 Feb 2015 18:43:14 +0100 Subject: MenuManager: use next iterator provided by erase instead of manual handling (bzr r3899.2.68) --- unity-shared/MenuManager.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'unity-shared') diff --git a/unity-shared/MenuManager.cpp b/unity-shared/MenuManager.cpp index e084001c6..c5eccab8f 100644 --- a/unity-shared/MenuManager.cpp +++ b/unity-shared/MenuManager.cpp @@ -165,10 +165,8 @@ struct Manager::Impl : sigc::trackable { for (auto it = entry_actions_.begin(); it != entry_actions_.end();) { - auto rm_it = it; - ++it; - key_grabber_->RemoveAction(*rm_it->second); - entry_actions_.erase(rm_it); + key_grabber_->RemoveAction(*it->second); + it = entry_actions_.erase(it); } } -- cgit v1.2.3 From fa8d4d20017ed681435c7c8ddc8a0f180bde786f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marco=20Trevisan=20=28Trevi=C3=B1o=29?= Date: Mon, 9 Feb 2015 18:43:23 +0100 Subject: UBusWrapper: use next iterator provided by erase instead of manual handling (bzr r3899.2.69) --- unity-shared/UBusWrapper.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'unity-shared') diff --git a/unity-shared/UBusWrapper.cpp b/unity-shared/UBusWrapper.cpp index 3f1699923..a66d4b5fd 100644 --- a/unity-shared/UBusWrapper.cpp +++ b/unity-shared/UBusWrapper.cpp @@ -34,10 +34,8 @@ UBusManager::~UBusManager() { for (auto it = connection_ids_.begin(); it != connection_ids_.end();) { - auto tmp_it = it; - ++it; - server->UnregisterInterest(*tmp_it); - connection_ids_.erase(tmp_it); + server->UnregisterInterest(*it); + it = connection_ids_.erase(it); } } -- cgit v1.2.3