Fixed assert() in ~AsyncTask obscuring other errors.

This commit is contained in:
Gunnar Beutner 2012-07-14 20:06:09 +02:00
parent fe237e0145
commit 59d4b2ef6b
1 changed files with 5 additions and 2 deletions

View File

@ -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;
}
}