Add_observer will it add twice the same observer ref?

I have to check, but just to be sure, will add_observer add the observer ref if already added in the list ? or it will ignore if already added.

It will add it again with no way of removing it. A real pain. I wish there would be a way to get a list of all observers for an object, and then remove any or all of them.

I do something like this:

unless @observer = nil 
  object.remove_observer @observer
  object.add_observer @observer

It’s no different than timers. If you start a new timer and assign it to a variable with out first stopping the timer associated with the timer variable, you loose your handle. I haven’t found a way in this case to stop the first timer other than restarting SketchUp.

1 Like

yeah I do the same silly thing, thanks.