diff --git a/src/KokkosComm_request.hpp b/src/KokkosComm_request.hpp index 71efd975..98629e02 100644 --- a/src/KokkosComm_request.hpp +++ b/src/KokkosComm_request.hpp @@ -54,7 +54,10 @@ class Req { // keep a reference to this view around until wait() is called template void keep_until_wait(const View &v) { - record_->until_waits_.push_back(std::make_shared>(v)); + // unmanaged views don't own the underlying buffer, so no need to extend lifetime + if (v.use_count() != 0) { + record_->until_waits_.push_back(std::make_shared>(v)); + } } private: