Merge pull request #2690 from 9rnsr/fix_dtors

Destructor handling issues with internal generated temporary variables