Skip to content
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

Error in destructor #7

Open
ChristianStadelmann opened this issue Dec 5, 2022 · 0 comments
Open

Error in destructor #7

ChristianStadelmann opened this issue Dec 5, 2022 · 0 comments

Comments

@ChristianStadelmann
Copy link
Contributor

ChristianStadelmann commented Dec 5, 2022

In my code, I create a processManager object. When it goes out of scope, i.e., when Matlab decides to call the destructor, I sporadically¹ see this error message:

The following error was caught while executing 'processManager' class destructor:
Error using timer/stop (line 34)
Invalid timer object. This object has been deleted and should be removed from your workspace using CLEAR.

Error in processManager/delete (line 483)
               stop(self.pollTimer);

I guess that this is a race condition between the destructor and the timer's stop() function calling pollTimerStop().

Would it help to turn pollTimerStop() into a non-static function which not only deletes the timer at the end, but also sets this.pollTimer = [];?


¹ sporadically in this context means something like once in 100 executions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant