「view this page in B3 βῆτα server」

Revisions №58313

branch: master 「№58313」
Commited by: Rocco Moretti
GitHub commit link: 「53ffa9b675358d49」 「№849」
Difference from previous tested commit:  code diff
Commit date: 2015-11-25 16:20:36

Merge pull request #849 from RosettaCommons/roccomoretti/pymol_obs Make the PyMolObserver a CacheableObserver. On certain systems there's an issue compiling because boost::bind via the observer system is expecting a raw pointer to the PyMolObserver, and it's being given an owning pointer. This works for boost shared pointers, but isn't robust for std::shared_ptr. The naive fix of simply giving things a raw pointer to the observer doesn't work, because AddPyMolObserver et al. doesn't keep around any reference to the newly created observer object, and if the PyRosetta-level user doesn't store the return value, the observer object gets garbage collected and subsequent observer notifications mean segfaults. To solve this, I changed the PyMolObserver into a CacheableObserver, and cache it in the pose which we're observing. One complication is that pose.clear() will remove any cached observers, resulting in the PyMolObserver being disconnected from the pose. The standard use cases look to be fixed, but it may be an issue in some other protocols. (Most notably, the PyMolObserver won't persist through loading a new PDB into the pose, as that calls pose.clear()) Another consequence is that not every snapshot from the previous runs are replicated in the new runs - but this should be mostly cosmetic.

...