From 59d4b2ef6bf33e9d8a140421b1860c38959fb29a Mon Sep 17 00:00:00 2001 From: Gunnar Beutner Date: Sat, 14 Jul 2012 20:06:09 +0200 Subject: [PATCH] Fixed assert() in ~AsyncTask obscuring other errors. --- base/asynctask.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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 +}