RobotWebTools / roslibjs

The Standard ROS JavaScript Library
https://robotwebtools.github.io/roslibjs
Other
659 stars 372 forks source link

Fix un-advertisement and multiple-advertisement of Service callbacks #701

Closed EzraBrooks closed 3 months ago

EzraBrooks commented 3 months ago

Public API Changes

Calling Service.advertise multiple times now throws an error, as suggested in #698. Bugfix: prevent resource leak of Service callbacks

Description

As noted in #698, Service un-advertisement apparently has never removed the callback from the service server, which is probably not good.. for both resource leak reasons and possible unexpected behavior reasons like a callback being invoked even after unadvertisement.