From: Gunnar Beutner Date: Thu, 28 Feb 2013 09:26:53 +0000 (+0100) Subject: Fixed incorrect lock in Notification::BeginExecuteNotificationHelper(). X-Git-Tag: v0.0.2~349 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ee4c8a5755d160fdb6c6d43276cf939bd93bb3cd;p=icinga2 Fixed incorrect lock in Notification::BeginExecuteNotificationHelper(). --- 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()); }