mirror of
https://github.com/pybind/pybind11.git
synced 2024-11-11 16:13:53 +00:00
MSVC 2015 compatibility.
This commit is contained in:
parent
45ec61f419
commit
5bb38c10b3
@ -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 {
|
||||||
|
Loading…
Reference in New Issue
Block a user