From ee4c8a5755d160fdb6c6d43276cf939bd93bb3cd Mon Sep 17 00:00:00 2001 From: Gunnar Beutner Date: Thu, 28 Feb 2013 10:26:53 +0100 Subject: [PATCH] Fixed incorrect lock in Notification::BeginExecuteNotificationHelper(). --- lib/icinga/notification.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/lib/icinga/notification.cpp b/lib/icinga/notification.cpp index a8a4e9e46..3e2d493c3 100644 --- a/lib/icinga/notification.cpp +++ b/lib/icinga/notification.cpp @@ -196,6 +196,14 @@ void Notification::BeginExecuteNotification(const Notification::Ptr& self, Notif } BOOST_FOREACH(const User::Ptr& user, allUsers) { + String user_name; + + { + ObjectLock olock(user); + user_name = user->GetName(); + } + + Logger::Write(LogDebug, "icinga", "Sending notification for user " + user_name); BeginExecuteNotificationHelper(self, macros, type, user); } @@ -211,7 +219,7 @@ void Notification::BeginExecuteNotificationHelper(const Notification::Ptr& self, if (user) { { - ObjectLock olock(self); + ObjectLock olock(user); macroDicts.push_back(user->GetMacros()); } -- 2.40.0