On Mon, Mar 14, 2016 at 01:27:08PM +0300, Nikolay Sivov wrote:
On 14.03.2016 13:01, Huw Davies wrote:
I'm wondering whether this patch could be split since it's doing rather more than fixing a ref counting issue. Could you move the constructor to CoGetContextToken first and then fix the refs, or would that mess up the tests?
That's exactly what I did initially, it was 3 patches series. And yes, it breaks tests if separated, which means it's regressing even if for a brief moment to be fixed by following commit, so I decided to merge them.
Ok.
One thing I'm a bit worried about is that it's possible for client to release this shared instance in a first place (and that's how it works on windows, e.g. if you release pointer returned by CoGetContextToken it will crash on subsequent method calls. Do we want to replicate that or maybe it's better to make it more reliable and never destroy on Release, but only in COM_TlsDestroy()?
I think we can leave it as you have it. If we find an app for which that causes problems, we can change it then.
Huw.