From: Adriano d. S. F. <adr...@gm...> - 2011-03-24 15:07:46
|
On 24-03-2011 11:56, Alex Peshkoff wrote: >> >> You see, reference counting alone don't solve the user problem. > > When used wrong - yes, do not. But if: > > T1: globalObj->addRef(); > T1: start T2 /* that's using globalObj */ > > It's OK. BTW, it's present in MS docs - "You must also call AddRef on a > pointer before passing it ....". > Reference counting is overloaded to make this work. With a single atomic variable user fix the problem without need a polluted API. It's user responsibility to use pointers before free them, and I showed you can't fix user mistakes. Adriano |