Add_observer will it add twice the same observer ref?

observer

#1

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.
thanks


Doubts about 'add_observer'
#2

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
end

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.


#3

yeah I do the same silly thing, thanks.