title: Understanding the "underlying C/C++ object has been deleted" error
body: <p>It's not the first time I am getting the <code>RuntimeError: underlying C/C++ object has been deleted</code>. I've solved it many times altering my code in a random but intuitive way but now I am facing this again and just don't understand why it happens...
  What I ask for is a generic approach to confront and solve this error.</p>
  
  <p>I will not post code samples here because my project is too complex and I just can't figure out where's the bug. And also because I am asking for the universal solution not just for this case.</p>
  
  <p><strong>Why can the 'underlying C/C++' objects be deleted?<br>
  How to avoid it?<br>
  How to test if the underlying object exists?</strong></p>