Fix some memory leaks in the tests

This commit is contained in:
Paul Cornett
2017-10-01 09:41:49 -07:00
parent 8c353236ac
commit fc7f20c419
6 changed files with 10 additions and 0 deletions

View File

@@ -146,6 +146,7 @@ void AtomicTestCase::TestWithThreads(int count, ETestType testType)
if ( thread->Create() != wxTHREAD_NO_ERROR )
{
wxLogError(wxT("Can't create thread!"));
delete thread;
}
else
threads.Add(thread);
@@ -161,6 +162,7 @@ void AtomicTestCase::TestWithThreads(int count, ETestType testType)
{
// each thread should return 0, else it detected some problem
CPPUNIT_ASSERT (threads[i]->Wait() == (wxThread::ExitCode)0);
delete threads[i];
}
CPPUNIT_ASSERT( int1 == 0 );