Talk:LlListenRemove

From Second Life Wiki
Jump to navigation Jump to search

Should we set the listen handler to zero after removing it?

I've come across some scripts where the author explicitly sets the handler to zero after releasing it, e.g.:

// [...]
gChannel = -123456789;
gDialogListener = llListen(gChannel, "", NULL_KEY, "");
// [...]
listen(integer channel, string name, key id, string message)
{
    llListenRemove(gDialogListener);
    gDialogListener = 0;
    // [...]
}

In my view, whatever the channel was before removing it, it is gone forever afterwards, i.e. there is no need to 'reset' it (also, why reset it to zero? Zero might be a valid handler ID... or isn't it?).

Am I right, or have LSL programming practices changed since I last looked this up? 🤓

Gwyneth Llewelyn (talk) 05:35, 23 April 2022 (PDT)