• Login
sketchucation logo sketchucation
  • Login
🔌 Quick Selection | Try Didier Bur's reworked classic extension that supercharges selections in SketchUp Download

Observers removed when entity is deleted?

Scheduled Pinned Locked Moved Developers' Forum
2 Posts 2 Posters 234 Views 2 Watching
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T Offline
    thomthom
    last edited by 15 Mar 2009, 13:30

    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?

    Thomas Thomassen — SketchUp Monkey & Coding addict
    List of my plugins and link to the CookieWare fund

    1 Reply Last reply Reply Quote 0
    • A Offline
      AdamB
      last edited by 17 Mar 2009, 09:19

      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

      Developer of LightUp Click for website

      1 Reply Last reply Reply Quote 0
      • 1 / 1
      1 / 1
      • First post
        1/2
        Last post
      Buy SketchPlus
      Buy SUbD
      Buy WrapR
      Buy eBook
      Buy Modelur
      Buy Vertex Tools
      Buy SketchCuisine
      Buy FormFonts

      Advertisement