Re: msvcp: free facet and _Locimp in Locimp dtor

2012-10-18 Thread Piotr Caban
On 10/17/12 19:20, Daniel Lehman wrote: How about something like the attached? Looks good for me. I would add base class destruction in _Locimp_dtor (locale::facet class). It's an empty function, but it's probably good to call it anyway, so if something changes in future it will be less likely

RE: msvcp: free facet and _Locimp in Locimp dtor

2012-10-17 Thread Daniel Lehman
> You can't add return value to locale__Locimp_dtor since it have to be > compatible with what native returns. I'm not sure how it's supposed to > work, I guess locale__Locimp_dtor should be only called when refcount > already is 0. I'll do some testing tomorrow. How about something like the attac

Re: msvcp: free facet and _Locimp in Locimp dtor

2012-10-17 Thread Piotr Caban
On 10/17/12 5:04 PM, Daniel Lehman wrote: Memory allocated for locale__Locimp object should be freed in locale class (locale_dtor function). You can't delete it here. Yeah, wasn't entirely sure about the location, but I want to call delete as soon as the refcount is 0 and can only reliably do

RE: msvcp: free facet and _Locimp in Locimp dtor

2012-10-17 Thread Daniel Lehman
> Memory allocated for locale__Locimp object should be freed in locale > class (locale_dtor function). You can't delete it here. > Yeah, wasn't entirely sure about the location, but I want to call delete as soon as the refcount is 0 and can only reliably do that there. locale_dtor can't count

Re: msvcp: free facet and _Locimp in Locimp dtor

2012-10-17 Thread Piotr Caban
On 10/17/12 02:35, Daniel Lehman wrote: @@ -7241,10 +7241,11 @@ void __thiscall locale__Locimp_dtor(locale__Locimp *this) MSVCP_size_t i; for(i=0; ifacet_cnt; i++) if(this->facetvec[i] && locale_facet__Decref(this->facetvec[i])) -call_locale_facet