mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-03 10:22:45 -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>
|
||||
INLINE void PointerToBase<T>::
|
||||
reassign(PointerToBase<T> &&from) NOEXCEPT {
|
||||
// Protect against self-move-assignment.
|
||||
if (from._void_ptr != this->_void_ptr) {
|
||||
To *old_ptr = (To *)this->_void_ptr;
|
||||
|
||||
this->_void_ptr = from._void_ptr;
|
||||
@ -80,6 +82,7 @@ reassign(PointerToBase<T> &&from) NOEXCEPT {
|
||||
if (old_ptr != (To *)NULL) {
|
||||
unref_delete(old_ptr);
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // USE_MOVE_SEMANTICS
|
||||
|
||||
|
@ -102,6 +102,8 @@ CopyOnWritePointer(CopyOnWritePointer &&move) NOEXCEPT :
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE void CopyOnWritePointer::
|
||||
operator = (CopyOnWritePointer &&move) NOEXCEPT {
|
||||
// Protect against self-move-assignment.
|
||||
if (move._cow_object != _cow_object) {
|
||||
CopyOnWriteObject *old_object = _cow_object;
|
||||
_cow_object = move._cow_object;
|
||||
move._cow_object = NULL;
|
||||
@ -109,6 +111,7 @@ operator = (CopyOnWritePointer &&move) NOEXCEPT {
|
||||
if (old_object != (CopyOnWriteObject *)NULL) {
|
||||
cache_unref_delete(old_object);
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // USE_MOVE_SEMANTICS
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user