core-framework icon indicating copy to clipboard operation
core-framework copied to clipboard

Fix for signal 11 on exit of a programmable device

Open btgoodwin opened this issue 6 years ago • 0 comments

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).

btgoodwin avatar Jun 14 '19 17:06 btgoodwin