Fix issue for setting shared pointers if both dest & src
point to the same object.
This commit is contained in:
1 parent
efe3e1778b
commit
8717f0ad1a
1 file changed
+4
-2
+4
-2
@@ -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); \
|
||||
} \
|
||||
} \
|
||||
\
|
||||
|
||||
|
||||
Reference in new issue
Block a user