From: Dimitry S. <sd...@ib...> - 2011-03-30 10:46:21
|
30.03.2011 12:32, Vlad Khorsun wrote: >> There is no difference. Whether pointer was invalid from the beginning or become, >> result is the same. > > Your example is a crash in *user* code, not in ours. Only if called function is virtual and is called via reference to base class. Otherwise crash will occur in _your_ code as soon as it try to access any member variable. > Reference counting prevents MT races in most cases, it is already used by our code > internally and allows user to not add additional locking layer for MT safety. Ok, here is a code: Interface* a = new RefCountedClass; Interface* b = NULL; b = a; delete a; b->Anything(); I don't understand how reference counting works here. Could you explain? -- SY, SD. |