
31 Aug
2004
31 Aug
'04
2:23 a.m.
On Mon, 2004-08-30 at 22:12, bulia byak wrote:
SPObject *oldmarker = sandbox->getObjectById("sample"); if (oldmarker) { sp_object_ref(oldmarker, NULL); oldmarker->deleteObject(false); sp_object_unref(oldmarker, NULL); }
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.
-mental