We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 6639ef6 commit 77060f5Copy full SHA for 77060f5
inst/include/cpp11/external_pointer.hpp
@@ -72,7 +72,9 @@ class external_pointer {
72
}
73
74
external_pointer& operator=(external_pointer&& rhs) noexcept {
75
+ // This works even if `this == &rhs` because `data_` (a `cpp11::sexp`) handles the underlying resource.
76
data_ = rhs.data_;
77
+ // Order matters: first assign, then clear the RHS.
78
rhs.data_ = R_NilValue;
79
return *this;
80
0 commit comments