mkazhdan / PoissonRecon

Poisson Surface Reconstruction
MIT License
1.59k stars 428 forks source link

Memory leaks caused by std::async on iOS #310

Open wamwamja opened 3 weeks ago

wamwamja commented 3 weeks ago

I don't know why, but I find memory leaks in PoissonRecon::ThreadPool::ParallelSections when I run it on iOS. (It works well on desktop platforms.)

After doing some debugging, l find leaks were caused by std::async(). I have little knowledge on multithreading, so I refer to cppreference and it seems the codes are exactly correct.

Anyway, if ThreadPool::ParallelizationType was set to ThreadPool::ParallelType::NONE, then the multithreading should be disabled everywhere?

mkazhdan commented 3 weeks ago

Thanks for catching that. Not sure why that's happening. The current implementation always uses async when parallelsection is invoked.