From: Michal 'vorner' Vaner Date: Mon, 1 Oct 2012 13:25:02 +0000 (+0200) Subject: [2202] Avoid delete in different thread X-Git-Tag: trac2402_base~79^2~5^2~4 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=936498565a5249df01ad44a808bb447952240c90;p=thirdparty%2Fkea.git [2202] Avoid delete in different thread --- diff --git a/src/lib/util/threads/tests/thread_unittest.cc b/src/lib/util/threads/tests/thread_unittest.cc index 4d477ee987..5f95d6171a 100644 --- a/src/lib/util/threads/tests/thread_unittest.cc +++ b/src/lib/util/threads/tests/thread_unittest.cc @@ -37,16 +37,14 @@ using namespace isc::util::thread; namespace { void -doSomething(int* x) { - delete[] x; -} +doSomething(int*) { } // We just test that we can forget about the thread and nothing // bad will happen on our side. TEST(ThreadTest, detached) { + int x; for (size_t i = 0; i < detached_iterations; ++i) { - int* x = new int[10]; - Thread thread(boost::bind(&doSomething, x)); + Thread thread(boost::bind(&doSomething, &x)); } }