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 attached?
It moves the call to _Decref up to locale_dtor, so _Locimp_dtor isn't even called if the refcount is non-zero
once it does hit zero, it both calls _Locimp_dtor followed by the delete
Thanks daniel