From 14f8ed8dd2878c1706d8b21255cfc26f6fa38340 Mon Sep 17 00:00:00 2001 From: Vinnie Falco Date: Sat, 17 Aug 2013 20:54:14 -0700 Subject: [PATCH] Fatal error if a Thread is destroyed while running --- modules/beast_core/threads/beast_Thread.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/modules/beast_core/threads/beast_Thread.cpp b/modules/beast_core/threads/beast_Thread.cpp index d4efea45af..0b43828e3d 100644 --- a/modules/beast_core/threads/beast_Thread.cpp +++ b/modules/beast_core/threads/beast_Thread.cpp @@ -40,7 +40,9 @@ Thread::~Thread() To avoid this type of nastiness, always make sure you call stopThread() before or during your subclass's destructor. */ - fatal_assert (! isThreadRunning()); + check_precondition (! isThreadRunning()); + + stopThread (); } //==============================================================================