@unknownuser said:
Yep. My understanding is that all delete methods are called after the fact. So the referenced object is toast by the time you are invoked.
Furthermore, I believe most problems caused by Observers is hanging onto stale references to Ruby objects that have been deleted. If you create null (do nothing) Observers, they are benign.
Adam
That's pretty much what I guessed. Unfortunately, the model reference passed in is not nil. It doesn't seem to reference anything but it doesn't compare equal to nil and it's not the active_model either. Ruby seems to be pretty good about detecting and reporting method calls on nil but I can see where having this mystery model reference might cause problems. Bottom line seems to be to clean up in onSaveModel and ignore onDeleteModel. I was trying to be a good citizen and remove all of my observers when the model was deleted but Sketchup doesn't seem to care or has already removed them.
One thing I can do when onDeleteModel is called is I do know 'self', so if I need to I can track all of my other observers as instance variables of my model observer.
Larry