| 935 | } |
| 936 | |
| 937 | WorkerThreadPool::~WorkerThreadPool() { |
| 938 | finish(); |
| 939 | |
| 940 | if (this == singleton) { |
| 941 | singleton = nullptr; |
| 942 | for (KeyValue<StringName, WorkerThreadPool *> &E : named_pools) { |
| 943 | E.value->finish(); |
| 944 | memdelete(E.value); |
| 945 | } |
| 946 | named_pools.clear(); |
| 947 | } |
| 948 | } |