Skip to content

Commit

Permalink
use sub and not delete
Browse files Browse the repository at this point in the history
  • Loading branch information
knorth55 committed Mar 25, 2023
1 parent 6ac8a40 commit defbba8
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions rostwitter/scripts/tweet_image_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ def _execute_cb(self, goal):
self.image_topic_name = goal.image_topic_name
with self.lock:
self.img[self.image_topic_name] = None
self.sub = rospy.Subscriber(
sub = rospy.Subscriber(
self.image_topic_name, Image,
self._image_cb)

Expand Down Expand Up @@ -130,8 +130,7 @@ def _execute_cb(self, goal):
else:
rospy.logerr('cannot subscribe image: {}'.format(self.image_topic_name))
ret = self.api.post_update(goal.text)
self.sub.unregister()
del self.sub
sub.unregister()
else:
ret = self.api.post_update(goal.text)

Expand Down

0 comments on commit defbba8

Please sign in to comment.