fixed bug in assignment operator
This commit is contained in:
1 parent
436532b079
commit
f7789d5434
1 file changed
+7
@@ -181,6 +181,13 @@ obj shared_ptr<T> (Object){
|
|||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fun operator=(newPtr: ref *T): ref shared_ptr<T> {
|
||||||
|
data = newPtr;
|
||||||
|
refCount = 1;
|
||||||
|
delete(newPtr,1);
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
|
||||||
}; //end shared_ptr class
|
}; //end shared_ptr class
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user