[sldev] Why won't isAvatar() work?

Dale Glass dale at daleglass.net
Thu Oct 4 04:42:00 PDT 2007


On Thu, Oct 04, 2007 at 07:21:57AM -0400, Michael Miller wrote:
> Dale,
> That idea seems good, but a hack nonetheless(since it needs to be made at
> object creation). 
Well, it's what's available :-)



> I want to modify the core SL code as little as possible. I
> remember in 1.18.1.2, the isAvatar() method worked at the end of the
> processObjectUpdate method. Has anything (significant) changed in this
> method since then? Are there no such smart pointers already in the code in
> the processObjectUpdate method? I'd rather (if at all possible) avoid using
> any code except at the end of the method after all the "original" SL code
> has been executed.
Yes, it's probably very impractical to rewrite it to use a LLPointer.

You may be running into an issue with the lifetime of objects. For
example, if you get a pointer to an object, then store it for the
duration of several frames, it may well disappear meanwhile if the user
for example teleported.

I'm not familiar with that bit yet, but you have to check the main loop
for the general order in which things are done. If you're getting a
pointer to something before the cleanup process, and try to use it
after the cleanup, the object may have been deleted during cleanup.

For things like that, it's a bad idea to keep pointers to them around.
For example, don't keep a pointer to LLViewerObject* across frames. If
you need to track an object over a long timeframe, keep its LLUUID, and
gObjectList.findObject(uid) when you need a pointer. findObject will
then return NULL if it's not there anymore.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://lists.secondlife.com/pipermail/sldev/attachments/20071004/e214f446/attachment.pgp


More information about the SLDev mailing list