Skip to content

Conversation

btgoodwin
Copy link

Upon shutdown of the programmable device with at least one associated persona device, a signal 11 is produced because of a bad clean-up.

The class destructor code actually does nothing since the map gets cleared by terminate's erase of everything in the map as the programmable device's releaseObject() cleans up its children. Never the less, delete of a Device_impl pointer is bad, rather you should _remove_ref(). However since iterating over the map is doing nothing, we can add the call to _remove_ref() after releaseObject() in the terminate() method, and then set the pointer to 0 to prevent its use in the future (which TBH is never since we're in the terminate function, but for the sake of following a best practice pattern, I kept it).

The destructor code actually does nothing since the map gets cleared by terminate's erase of everything in the map.  Never the less, delete of a Device_impl pointer is bad, rather you should _remove_ref().  However since that code is never reached, we can add the call to _remove_ref() after releaseObject() and then set the pointer to 0 to prevent its use in the future (which TBH is never since we're in the terminate function).
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

Successfully merging this pull request may close these issues.

1 participant