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