summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--include/stc/csptr.h5
1 files changed, 2 insertions, 3 deletions
diff --git a/include/stc/csptr.h b/include/stc/csptr.h
index 11dfaa5a..b0857a25 100644
--- a/include/stc/csptr.h
+++ b/include/stc/csptr.h
@@ -157,12 +157,11 @@ cx_memb(_reset_make)(Self* self, cx_value_t val) {
return self->get;
}
-STC_INLINE cx_value_t*
+STC_INLINE void
cx_memb(_copy)(Self* self, Self ptr) {
+ if (ptr.use_count) cx_increment(ptr.use_count);
cx_memb(_del)(self);
*self = ptr;
- if (self->use_count) cx_increment(self->use_count);
- return self->get;
}
STC_INLINE int