let removelistener() return the number of remaining Nasal listeners. (We
need to return nil for errors and something else for success, so we can as well return something (remotely) useful.)
This commit is contained in:
parent
e4fe99ce12
commit
dcffb9d335
1 changed files with 3 additions and 2 deletions
|
@ -626,8 +626,9 @@ naRef FGNasalSys::setListener(int argc, naRef* args)
|
||||||
|
|
||||||
FGNasalListener *nl = new FGNasalListener(node, handler, this,
|
FGNasalListener *nl = new FGNasalListener(node, handler, this,
|
||||||
gcSave(handler));
|
gcSave(handler));
|
||||||
_listener[_listenerId] = nl;
|
|
||||||
node->addChangeListener(nl, initial);
|
node->addChangeListener(nl, initial);
|
||||||
|
|
||||||
|
_listener[_listenerId] = nl;
|
||||||
return naNum(_listenerId++);
|
return naNum(_listenerId++);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -647,6 +648,6 @@ naRef FGNasalSys::removeListener(int argc, naRef* args)
|
||||||
nl->_node->removeChangeListener(nl);
|
nl->_node->removeChangeListener(nl);
|
||||||
_listener.erase(i);
|
_listener.erase(i);
|
||||||
delete nl;
|
delete nl;
|
||||||
return id;
|
return naNum(_listener.size());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue