summaryrefslogtreecommitdiffhomepage
path: root/include
diff options
context:
space:
mode:
authorTyge Løvset <[email protected]>2021-09-22 13:13:22 +0200
committerTyge Løvset <[email protected]>2021-09-22 13:13:22 +0200
commit50a8a8559147fd27aa5f3e371f06ec20c8566cf6 (patch)
tree86d8a5682f566c8dcf94a7fbb10f3149a43bf12d /include
parent7f542d18fedae0e473ed779c2b93479e473b9feb (diff)
downloadSTC-modified-50a8a8559147fd27aa5f3e371f06ec20c8566cf6.tar.gz
STC-modified-50a8a8559147fd27aa5f3e371f06ec20c8566cf6.zip
Fix: allow csptr self-take.
Diffstat (limited to 'include')
-rw-r--r--include/stc/csptr.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/include/stc/csptr.h b/include/stc/csptr.h
index 58392bb1..f8b02c0b 100644
--- a/include/stc/csptr.h
+++ b/include/stc/csptr.h
@@ -163,7 +163,8 @@ cx_memb(_copy)(Self* self, Self ptr) {
STC_INLINE void
cx_memb(_take)(Self* self, Self ptr) {
- cx_memb(_del)(self); *self = ptr;
+ if (self->get != ptr.get) cx_memb(_del)(self);
+ *self = ptr;
}
STC_INLINE int