http://bugs.winehq.org/show_bug.cgi?id=27168
--- Comment #36 from Juan Lang juan_lang@yahoo.com 2011-09-28 17:33:54 CDT --- I'm glad you're thinking about the problem: what exists is what grew as I wrote it, not from any well-thought-out design. So I'm not surprised that there are bugs in reference counting.
I think you may be right in wanting to isolate the problem of context reference counts from store reference counts. That might make it possible to reason about them separately. (It also might be possible to implement features of stores that aren't yet supported, e.g. CERT_CLOSE_STORE_CHECK_FLAG and CERT_CLOSE_STORE_FORCE_FLAG, but that's beyond the scope of this bug.)
I'm not sure if that's useful advice or not. So could you talk about collection stores, and what problems you were having with them?