From: Alex P. <pes...@ma...> - 2011-03-31 10:06:23
|
On 03/30/11 18:39, Adriano dos Santos Fernandes wrote: >> Do you see the difference ? >> > If user pass an invalid pointer parameter, it *will* crash in our code: > > provider->attachDatabase((Status*) 0x1, (char*) 0x1, ...); > > We can't prevent wrong program from crashing in our code. The same is about: > > freedObject->something(); Adriano, without reference counts we really can't prevent crash with freedObject. And one of main reasons for reference counters to exist - prevent such crashes. |