Code indexing in gitaly is broken and leads to code not being visible to the user. We work on the issue with highest priority.

Skip to content
Snippets Groups Projects
Commit e8e3cc70 authored by snuverink_j's avatar snuverink_j
Browse files

fix bug in assignment operator: check for equality before deletion and assignment

parent 950ed843
No related branches found
No related tags found
1 merge request!386Resolve "Remove wrappers"
......@@ -135,9 +135,11 @@ inline Pointer<Object> &Pointer<Object>::operator=(const Pointer &rhs) {
template < class Object >
inline Pointer<Object> &Pointer<Object>::operator=(Object *obj) {
if(object && object->removeReference() <= 0) delete object;
object = obj;
if(object) object->addReference();
if(object != obj) {
if(object && object->removeReference() <= 0) delete object;
object = obj;
if(object) object->addReference();
}
return *this;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment