diff --git a/base/asynctask.cpp b/base/asynctask.cpp index 7b09f83d9..229aed342 100644 --- a/base/asynctask.cpp +++ b/base/asynctask.cpp @@ -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; -} \ No newline at end of file +}