MSVC 2015 compatibility.

This commit is contained in:
Ralf W. Grosse-Kunstleve 2021-06-14 15:00:10 -07:00 committed by Ralf W. Grosse-Kunstleve
parent 45ec61f419
commit 5bb38c10b3
1 changed files with 2 additions and 0 deletions

View File

@ -112,7 +112,9 @@ struct RescuingDeleter {
explicit RescuingDeleter(PyWrapper *pyw) : pyw{pyw} {} explicit RescuingDeleter(PyWrapper *pyw) : pyw{pyw} {}
void operator()(ToBeWrapped *raw_ptr) { void operator()(ToBeWrapped *raw_ptr) {
if (pyw->self.get() != nullptr) { if (pyw->self.get() != nullptr) {
#if !defined(_MSC_VER) || _MSC_VER >= 1912
assert(raw_ptr->weak_from_this().expired()); // CRITICAL assert(raw_ptr->weak_from_this().expired()); // CRITICAL
#endif
pyw->wobj = std::shared_ptr<ToBeWrapped>(raw_ptr, *this); pyw->wobj = std::shared_ptr<ToBeWrapped>(raw_ptr, *this);
pyw->self.reset(); pyw->self.reset();
} else { } else {