From 8a1606a3c6d9e8770a94e9d4968884b9005567d3 Mon Sep 17 00:00:00 2001 From: Xawotihs Date: Wed, 16 Nov 2011 20:49:26 +0000 Subject: [PATCH] Compilation fixes for Android+boost --- projects/mtg/include/TestSuiteAI.h | 2 +- projects/mtg/src/TestSuiteAI.cpp | 12 +++++++++--- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/projects/mtg/include/TestSuiteAI.h b/projects/mtg/include/TestSuiteAI.h index 14e6af2de..5829cbc96 100644 --- a/projects/mtg/include/TestSuiteAI.h +++ b/projects/mtg/include/TestSuiteAI.h @@ -81,7 +81,7 @@ private: string files[1024]; void cleanup(); - vector mWorkerThread; + vector mWorkerThread; Rules* mRules; bool mProcessing; diff --git a/projects/mtg/src/TestSuiteAI.cpp b/projects/mtg/src/TestSuiteAI.cpp index 24b9d2531..62fb21f78 100644 --- a/projects/mtg/src/TestSuiteAI.cpp +++ b/projects/mtg/src/TestSuiteAI.cpp @@ -452,7 +452,8 @@ TestSuite::~TestSuite() mProcessing = false; while(mWorkerThread.size()) { - mWorkerThread.back().join(); + mWorkerThread.back()->join(); + SAFE_DELETE(mWorkerThread.back()); mWorkerThread.pop_back(); } @@ -545,13 +546,18 @@ int TestSuite::loadNext() if(!mProcessing) { // "I don't like to wait" mode mProcessing = true; - mWorkerThread.clear(); + while(mWorkerThread.size()) + { + mWorkerThread.back()->join(); + SAFE_DELETE(mWorkerThread.back()); + mWorkerThread.pop_back(); + } size_t thread_count = 1; #ifdef QT_CONFIG thread_count = QThread::idealThreadCount(); #endif for(size_t i = 0; i < (thread_count-1); i++) - mWorkerThread.push_back(boost::thread(ThreadProc, this)); + mWorkerThread.push_back(new boost::thread(ThreadProc, this)); } cleanup();