-
Notifications
You must be signed in to change notification settings - Fork 17
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
IOListener is deleted twice #14
Comments
Would make IMO more sense to transfer ownership to the driver. What do you think ? |
I agree, but the task needs still needs to keep a reference to the listener if it wants to remove it from the driver. Maybe using shared_ptr is more safe?
and
|
Sounds good, |
I'm very much against it. Making it a shared pointer removes the double-free, but would not remove the "use listener that the driver is not using anymore" which makes no sense. iodrivers_base should take ownership of the listener, make it clear in the documentation and do not delete the listener from the task. |
The IOListener is owned by iodriver_base::Task but is deleted in both the task and the driver. Removing it from the driver seems to prevent a possible crash.
The text was updated successfully, but these errors were encountered: