]> granicus.if.org Git - icinga2/commitdiff
Fixed incorrect lock in Notification::BeginExecuteNotificationHelper().
authorGunnar Beutner <gunnar.beutner@netways.de>
Thu, 28 Feb 2013 09:26:53 +0000 (10:26 +0100)
committerGunnar Beutner <gunnar.beutner@netways.de>
Thu, 28 Feb 2013 09:26:53 +0000 (10:26 +0100)
lib/icinga/notification.cpp

index a8a4e9e4625dea4ba1f1ee33b0ac9f782e474fb8..3e2d493c30c6ae26fa8b797cbce2aceeb458625b 100644 (file)
@@ -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());
                }