fix Issue 11286 - Impure dtor makes "cannot call impure function" error, although it won't actually be called.
Merge pull request #2677 from 9rnsr/fix11286

Issue 11286 - Impure dtor makes "cannot call impure function" error, although it won't actually be called.