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

on_stop() is not called on destruction of a monitor #136

Open
Andrepuel opened this issue Sep 22, 2016 · 3 comments
Open

on_stop() is not called on destruction of a monitor #136

Andrepuel opened this issue Sep 22, 2016 · 3 comments

Comments

@Andrepuel
Copy link

Destruction happens bottom-up, meaning that once the ~monitor method is executing, the subclass is not existent anymore and the on_stop method will dispatch to the no-op one.

This is a blocking issue for who is using the C binding as destroying a monitor is the only way to stop it.

I suggest that every subclass of monitor should call stop() explicitly.

@emcrisostomo
Copy link
Owner

The destructor calling stop() was meant as a safety net: each monitor should be stopped gracefully with stop(). The C binding is missing a stop() function and that's what I think we should add for starters.

@emcrisostomo
Copy link
Owner

Created #143 to provide a mean to stop a monitor from the C API.

@emcrisostomo
Copy link
Owner

I'm considering updating the monitor behaviour to fail in some way (probably call std::terminate) if a monitor is destroyed while still running.

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

2 participants