summaryrefslogtreecommitdiff
path: root/dev-cpp/threadpool/files
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2019-10-13 22:11:03 +0100
committerV3n3RiX <venerix@redcorelinux.org>2019-10-13 22:11:03 +0100
commit2929788def9a92c1eb237eed93fbdb0c02838bbf (patch)
tree166b01591366d3479084ea774c888bc84aaa8d4f /dev-cpp/threadpool/files
parentab499d7cfb9ad23e83cf7a4f5052bdf1b4c42030 (diff)
Revert "gentoo resync : 13.10.2019"
This reverts commit ab499d7cfb9ad23e83cf7a4f5052bdf1b4c42030.
Diffstat (limited to 'dev-cpp/threadpool/files')
-rw-r--r--dev-cpp/threadpool/files/threadpool-0.2.5-memleak.patch22
1 files changed, 22 insertions, 0 deletions
diff --git a/dev-cpp/threadpool/files/threadpool-0.2.5-memleak.patch b/dev-cpp/threadpool/files/threadpool-0.2.5-memleak.patch
new file mode 100644
index 000000000000..26d89d1d5c25
--- /dev/null
+++ b/dev-cpp/threadpool/files/threadpool-0.2.5-memleak.patch
@@ -0,0 +1,22 @@
+Fix memleak due circular references blocking garbage collection.
+
+http://www.cplusplus.com/forum/general/56971/ provides a testcase for a memory
+leak with the threadpool due to shared_ptr usage.
+
+I really needed threadpool to work for me, so I traced & fixed it as best as
+possible. When the threadpool is being destroyed, your threads should have
+terminated already. Do so deliberately if not done yet, so that they free the
+memory.
+
+Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
+
+--- threadpool/boost/threadpool/detail/pool_core.hpp
++++ threadpool/boost/threadpool/detail/pool_core.hpp
+@@ -150,6 +150,7 @@
+ /// Destructor.
+ ~pool_core()
+ {
++ terminate_all_workers(true);
+ }
+
+ /*! Gets the size controller which manages the number of threads in the pool.