mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-04 19:08:55 -04:00
Merge branch 'release/1.9.x'
This commit is contained in:
commit
4df64f7b42
@ -71,6 +71,8 @@ PointerToBase(PointerToBase<T> &&from) NOEXCEPT {
|
|||||||
template<class T>
|
template<class T>
|
||||||
INLINE void PointerToBase<T>::
|
INLINE void PointerToBase<T>::
|
||||||
reassign(PointerToBase<T> &&from) NOEXCEPT {
|
reassign(PointerToBase<T> &&from) NOEXCEPT {
|
||||||
|
// Protect against self-move-assignment.
|
||||||
|
if (from._void_ptr != this->_void_ptr) {
|
||||||
To *old_ptr = (To *)this->_void_ptr;
|
To *old_ptr = (To *)this->_void_ptr;
|
||||||
|
|
||||||
this->_void_ptr = from._void_ptr;
|
this->_void_ptr = from._void_ptr;
|
||||||
@ -81,6 +83,7 @@ reassign(PointerToBase<T> &&from) NOEXCEPT {
|
|||||||
unref_delete(old_ptr);
|
unref_delete(old_ptr);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
#endif // USE_MOVE_SEMANTICS
|
#endif // USE_MOVE_SEMANTICS
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
|
@ -102,6 +102,8 @@ CopyOnWritePointer(CopyOnWritePointer &&move) NOEXCEPT :
|
|||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
INLINE void CopyOnWritePointer::
|
INLINE void CopyOnWritePointer::
|
||||||
operator = (CopyOnWritePointer &&move) NOEXCEPT {
|
operator = (CopyOnWritePointer &&move) NOEXCEPT {
|
||||||
|
// Protect against self-move-assignment.
|
||||||
|
if (move._cow_object != _cow_object) {
|
||||||
CopyOnWriteObject *old_object = _cow_object;
|
CopyOnWriteObject *old_object = _cow_object;
|
||||||
_cow_object = move._cow_object;
|
_cow_object = move._cow_object;
|
||||||
move._cow_object = NULL;
|
move._cow_object = NULL;
|
||||||
@ -110,6 +112,7 @@ operator = (CopyOnWritePointer &&move) NOEXCEPT {
|
|||||||
cache_unref_delete(old_object);
|
cache_unref_delete(old_object);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
#endif // USE_MOVE_SEMANTICS
|
#endif // USE_MOVE_SEMANTICS
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
|
Loading…
x
Reference in New Issue
Block a user