1. Aug 31, 2017
  2. Aug 30, 2017
  3. Aug 28, 2017
  4. Aug 26, 2017
  5. Aug 25, 2017
    • Wenzel Jakob's avatar
      Address reference leak issue (fixes #1029) · c14c2762
      Wenzel Jakob authored
      Creating an instance of of a pybind11-bound type caused a reference leak in the
      associated Python type object, which could prevent these from being collected
      upon interpreter shutdown. This commit fixes that issue for all types that are
      defined in a scope (e.g. a module). Unscoped anonymous types (e.g. custom
      iterator types) always retain a positive reference count to prevent their
      collection.
      c14c2762
    • Henry Schreiner's avatar
      8b405055
  6. Aug 24, 2017
  7. Aug 23, 2017
  8. Aug 22, 2017
  9. Aug 21, 2017
  10. Aug 20, 2017
    • Patrik Huber's avatar
      Fix typos in Eigen documentation · d265933d
      Patrik Huber authored
      Fixes one small variable name typo, and two instances where `py::arg().nocopy()` is used, where I think it should be `py::arg().noconvert()` instead. Probably `nocopy()` was the old/original name for it and then it was changed.
      d265933d
    • Jason Rhinelander's avatar
      Allow module-local classes to be loaded externally · 5e14aa6a
      Jason Rhinelander authored
      The main point of `py::module_local` is to make the C++ -> Python cast
      unique so that returning/casting a C++ instance is well-defined.
      Unfortunately it also makes loading unique, but this isn't particularly
      desirable: when an instance contains `Type` instance there's no reason
      it shouldn't be possible to pass that instance to a bound function
      taking a `Type` parameter, even if that function is in another module.
      
      This commit solves the issue by allowing foreign module (and global)
      type loaders have a chance to load the value if the local module loader
      fails.  The implementation here does this by storing a module-local
      loading function in a capsule in the python type, which we can then call
      if the local (and possibly global, if the local type is masking a global
      type) version doesn't work.
      5e14aa6a
  11. Aug 17, 2017
    • Jason Rhinelander's avatar
      Remove PYBIND11_UNSHARED_STATIC_LOCALS macro · 39498b2b
      Jason Rhinelander authored
      The macro isn't doing anything useful now that hidden visibility is
      applied to all pybind11 code.
      39498b2b
    • Jason Rhinelander's avatar
      Reimplement py::init<...> to use common factory code · c4e18008
      Jason Rhinelander authored
      This reimplements the py::init<...> implementations using the various
      functions added to support `py::init(...)`, and moves the implementing
      structs into `detail/init.h` from `pybind11.h`.  It doesn't simply use a
      factory directly, as this is a very common case and implementation
      without an extra lambda call is a small but useful optimization.
      
      This, combined with the previous lazy initialization, also avoids
      needing placement new for `py::init<...>()` construction: such
      construction now occurs via an ordinary `new Type(...)`.
      
      A consequence of this is that it also fixes a potential bug when using
      multiple inheritance from Python: it was very easy to write classes
      that double-initialize an existing instance which had the potential to
      leak for non-pod classes.  With the new implementation, an attempt to
      call `__init__` on an already-initialized object is now ignored.  (This
      was already done in the previous commit for factory constructors).
      
      This change exposed a few warnings (fixed here) from deleting a pointer
      to a base class with virtual functions but without a virtual destructor.
      These look like legitimate warnings that we shouldn't suppress; this
      adds virtual destructors to the appropriate classes.
      c4e18008