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 that there. locale_dtor
can't count on refcount when multiple threads are used. should I change
locale__Locimp_dtor to return true if locale_dtor should call delete?
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.
Cheers,
Piotr