Closed weifang1 closed 7 years ago
The current implementation of Singleton requires users to manually delete the instance and there is no such code to do that so there would be memory leaks. Actually, in C++11, Meyers Singleton is a simpler and more powerful way to do that: https://github.com/blengerich/GenAMap/blob/valgrind_check/src/Scheduler/Scheduler.cpp#L94
Some explanations about Meyers Singleton: http://stackoverflow.com/a/17713799
This modification can eliminate most memory leaks in the scheduler. There are still some other leaks (128 bytes) but it seems that they come from uv_queue_work().
The current implementation of Singleton requires users to manually delete the instance and there is no such code to do that so there would be memory leaks. Actually, in C++11, Meyers Singleton is a simpler and more powerful way to do that: https://github.com/blengerich/GenAMap/blob/valgrind_check/src/Scheduler/Scheduler.cpp#L94
Some explanations about Meyers Singleton: http://stackoverflow.com/a/17713799
This modification can eliminate most memory leaks in the scheduler. There are still some other leaks (128 bytes) but it seems that they come from uv_queue_work().