Fix issue for setting shared pointers if both dest & src

point to the same object.
This commit is contained in:
Patrick Pelissier committed 2017-11-25 22:41:55 +01:00
1 parent efe3e1778b
commit 8717f0ad1a
1 file changed
+4 -2
+4 -2
View File
@@ -135,8 +135,10 @@
M_C(name, _set)(type ** ptr, type *shared) \
{ \
assert (ptr != NULL); \
M_C(name, _clear)(*ptr); \
*ptr = M_C(name, _init_set)(shared); \
if (M_LIKELY (*ptr != shared)) { \
M_C(name, _clear)(*ptr); \
*ptr = M_C(name, _init_set)(shared); \
} \
} \
\