From: Gunnar Beutner Date: Mon, 24 Jun 2013 06:56:13 +0000 (+0200) Subject: Fix: Compat Log: abort on OwnLock() X-Git-Tag: v0.0.2~78 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ea0052f208e35d6de1477a8f0e689e919160b917;p=icinga2 Fix: Compat Log: abort on OwnLock() Fixes #4332 --- diff --git a/components/compat/compatlog.cpp b/components/compat/compatlog.cpp index 20df8965a..e7d93dc12 100644 --- a/components/compat/compatlog.cpp +++ b/components/compat/compatlog.cpp @@ -156,7 +156,10 @@ void CompatLog::CheckResultRequestHandler(const RequestMessage& request) << attempt_after << ";" << ""; - WriteLine(msgbuf.str()); + { + ObjectLock olock(this); + WriteLine(msgbuf.str()); + } if (service == host->GetHostCheckService()) { std::ostringstream msgbuf; @@ -167,10 +170,17 @@ void CompatLog::CheckResultRequestHandler(const RequestMessage& request) << attempt_after << ";" << ""; - WriteLine(msgbuf.str()); + { + ObjectLock olock(this); + WriteLine(msgbuf.str()); + } + } - Flush(); + { + ObjectLock olock(this); + Flush(); + } } void CompatLog::WriteLine(const String& line)