Observers removed when entity is deleted?
-
I'm wondering, if I attach en EntityObserver to an entity, is that observer removed if the entity is deleted? Or does it linger around in memory? Should I remove the observer when the entity is deleted?
-
I've found it to be a "theological gray area"!
Because if you have an observer on an object there is an argument that this is a reference and therefore the observee is going to hang around and not be GCed. Let alone the Observer proper.
As a general rule for Ruby programming - particularly for SU where the Ruby objects are essentially proxies - if you have the opportunity to break references, do so.
Adam
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better π
Register LoginAdvertisement