From f695ff7094a00482c407f8769a09f8b41c8de66d Mon Sep 17 00:00:00 2001 From: Nik Henson Date: Sun, 18 Sep 2011 22:49:21 +0000 Subject: [PATCH] CModel3::StopThreads() now makes sures threads are paused before deleting thread objects. --- Src/Model3/Model3.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Src/Model3/Model3.cpp b/Src/Model3/Model3.cpp index 9ebb2c8..134e767 100644 --- a/Src/Model3/Model3.cpp +++ b/Src/Model3/Model3.cpp @@ -2055,10 +2055,13 @@ void CModel3::StopThreads(void) if (!startedThreads) return; - // Remove callback + // If sound board not sync'd then remove callback if (!syncSndBrdThread) SetAudioCallback(NULL, NULL); - + + // Pause threads so that can safely delete thread objects + PauseThreads(); + DeleteThreadObjects(); startedThreads = false; }