mirror of
https://github.com/Icinga/icinga2.git
synced 2025-07-29 16:44:29 +02:00
Fixed assert() in ~AsyncTask obscuring other errors.
This commit is contained in:
parent
fe237e0145
commit
59d4b2ef6b
@ -27,7 +27,10 @@ AsyncTask::AsyncTask(const AsyncTask::CompletionCallback& completionCallback)
|
||||
|
||||
AsyncTask::~AsyncTask(void)
|
||||
{
|
||||
assert(m_Finished);
|
||||
if (!m_Finished) {
|
||||
Logger::Write(LogCritical, "base", "Contract violation: "
|
||||
"AsyncTask was destroyed before its completion callback was invoked.");
|
||||
}
|
||||
}
|
||||
|
||||
void AsyncTask::Start(void)
|
||||
@ -47,4 +50,4 @@ void AsyncTask::ForwardCallback(void)
|
||||
m_CompletionCallback(GetSelf());
|
||||
m_CompletionCallback = CompletionCallback();
|
||||
m_Finished = true;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user