Fix issue #795 — Struct dtor called twice under some circumstances