New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[SofaSimulationCore] FIX Task scheduler memory leak #1927
Conversation
The static raw pointer had two bad effects: - Memory leak - Task scheduler not being stopped
[ci-build][with-all-tests] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good to use a smart pointer and fix the memory leak.
What about using a unique_ptr ?
The task scheduler should manage itself and no other class should control its lifetime storing a refernce to it.
@fspadoni you're right, I'll change it |
@fspadoni Is the task scheduler designed to have local schedulers? For example, can I have a task scheduler specific to a component? Is it restricted to have only one instance per derived type? |
There is only one global instance of the task scheduler class and this is shared between all components. |
@hugtalbot @guparan I am not sure I just need to switch from EXPECT_EQ to EXPECT_NE. When I'll refactor the interface of the TaskScheduler, a large majority of the test will not make sense. I suggest to merge this PR now, and I'll change the tests in my next PR. |
[ci-build][with-all-tests] |
I removed completely the unit tests. I'll add them later in another pull request. |
Looks fine to me but I am really no MT / TaskScheduler expert |
sofa-framework#1927 is suspected to causes crashes in multi-threaded scenes on Jenkins
…to check CI" This reverts commit cadedce
Fix memory leak in task scheduler:
The static raw pointer had two bad effects:
Note: The current API for the task scheduler is very confusing. I suggest to clarify the expected behavior.
By submitting this pull request, I acknowledge that
I have read, understand, and agree SOFA Developer Certificate of Origin (DCO).
Reviewers will merge this pull-request only if