17 Oct
2015
17 Oct
'15
6:07 p.m.
a) refinement of codecvt facet lifetime issue.
I think this is the issue, you: * Create the facet as a data member of the archive. * Imbue it in a locale and then install that locale in the iostream. Now on destruction: * The archive is destroyed first, this destructs the locale facet *that's still in the iostream*. * The iostream then calls the destructor on an object that's already been destroyed. Depending on the virtual function / destructor implementation, you may or may not see this as an error at runtime. So I think you need to back up the iostream's locale and restore it in the archive destructor if you want to go this way. Apologies if I've misread your code, HTH, John. Update: I think I have a fix, testing now...