From: | "Robin H. Johnson (robbat2)" <robbat2@g.o> |
---|---|
To: | gentoo-commits@l.g.o |
Subject: | [gentoo-commits] gentoo-x86 commit in dev-cpp/threadpool/files: threadpool-0.2.5-memleak.patch |
Date: | Sat, 29 Sep 2012 23:14:52 |
Message-Id: | 20120929231438.230E921601@flycatcher.gentoo.org |
1 | robbat2 12/09/29 23:14:38 |
2 | |
3 | Added: threadpool-0.2.5-memleak.patch |
4 | Log: |
5 | Initial commit. Ebuild by Robin H. Johnson <robbat2@g.o>. |
6 | |
7 | (Portage version: 2.2.0_alpha121/cvs/Linux x86_64) |
8 | |
9 | Revision Changes Path |
10 | 1.1 dev-cpp/threadpool/files/threadpool-0.2.5-memleak.patch |
11 | |
12 | file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-cpp/threadpool/files/threadpool-0.2.5-memleak.patch?rev=1.1&view=markup |
13 | plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-cpp/threadpool/files/threadpool-0.2.5-memleak.patch?rev=1.1&content-type=text/plain |
14 | |
15 | Index: threadpool-0.2.5-memleak.patch |
16 | =================================================================== |
17 | Fix memleak due circular references blocking garbage collection. |
18 | |
19 | http://www.cplusplus.com/forum/general/56971/ provides a testcase for a memory |
20 | leak with the threadpool due to shared_ptr usage. |
21 | |
22 | I really needed threadpool to work for me, so I traced & fixed it as best as |
23 | possible. When the threadpool is being destroyed, your threads should have |
24 | terminated already. Do so deliberately if not done yet, so that they free the |
25 | memory. |
26 | |
27 | Signed-off-by: Robin H. Johnson <robbat2@g.o> |
28 | |
29 | --- threadpool-0_2_5-src/threadpool/boost/threadpool/detail/pool_core.hpp 2012-09-27 22:33:21.098626892 -0700 |
30 | +++ threadpool-0_2_5-src/threadpool/boost/threadpool/detail/pool_core.hpp 2012-09-27 22:51:12.291997839 -0700 |
31 | @@ -150,6 +150,7 @@ |
32 | /// Destructor. |
33 | ~pool_core() |
34 | { |
35 | + terminate_all_workers(true); |
36 | } |
37 | |
38 | /*! Gets the size controller which manages the number of threads in the pool. |