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