Closed v4hn closed 8 years ago
+1 makes sense to me, those classes already clear themselves
@v4hn I tested this and it works for me in my cpp code!
Checking with AddressSanitizer, this PR of course doesn't resolve #592, although - by chance - it doesn't crashes the program in normal operation mode anymore. Of course, if there is no need for a specific destruction order of members, the destructor could be removed. +1
Only noticed now: Probably this PR destroys ABI compatibility, because it now falls back to the default destructor?
I have no idea why I failed to notice that before merging, but it is ABI breaking. Therefore I reverted the change in indigo-devel and applied it to jade-devel only.
What if you simply remove the .reset() from the destructor ?
Sure, but
The destructor only resetted shared_ptr of the class. This automatically happens after the destructor finished anyway and the explicit resets disturb the default destructor order of the data structures.
Additionally this has the same effect as #702 and for some reason works around #592 over here. This is not meant as a fix for #592, but it resolves the problem for the moment without adding new unnecessary code. The real bug, as @rhaschke pointed out, lies in internal design faults of pluginlib and class_loader and has to be resolved there.