
On Mon, 30 Aug 2004 22:23:14 -0400, MenTaLguY <mental@...3...> wrote:
On Mon, 2004-08-30 at 22:12, bulia byak wrote:
Can't we just add those ref/unref calls to the beginning and the end of the deleteObject?
I've been thinking about it.
I guess my main hesistation is that I don't want to make it look OK to do anything with SPObjects without owning references to them.
In the case of deleteObject(), you'll usually get slapped by a crash -- in other cases the bugs from playing loose with refcounts would manifest themselves less frequently and be harder to debug.
Obviously, my next suggestion would be to add the similar ref/unref to any other SPObject methods that need the object to stay live while they do something to it. I think it's natural for them to take care of it, if they need it. And I think it's highly unnatural to require the users' code to add artificial refs when all they want to do is to delete the stinking object :)