-
Notifications
You must be signed in to change notification settings - Fork 257
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove manual ref counting for BundleResource #695
Conversation
Signed-off-by: The MathWorks, Inc. <alchrist@mathworks.com>
Codecov Report
@@ Coverage Diff @@
## development #695 +/- ##
===============================================
- Coverage 90.46% 90.36% -0.10%
===============================================
Files 248 233 -15
Lines 13643 13381 -262
===============================================
- Hits 12342 12092 -250
+ Misses 1301 1289 -12
|
BundleResource& BundleResource::operator=(const BundleResource& resource) | ||
{ | ||
BundleResourcePrivate* curr_d = d; | ||
d = resource.d; | ||
++d->ref; | ||
|
||
if (!--curr_d->ref) | ||
delete curr_d; | ||
|
||
return *this; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can the copy assignment operator be =default
? I don't think we need a user-defined implementation for this now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. That seems like the right change here.
Signed-off-by: The MathWorks, Inc. <alchrist@mathworks.com>
* Removed manual ref counting for BundleResource Signed-off-by: The MathWorks, Inc. <alchrist@mathworks.com> * Made changes requested by reviewer Signed-off-by: The MathWorks, Inc. <alchrist@mathworks.com>
* Removed manual ref counting for BundleResource * Made changes requested by reviewer Signed-off-by: The MathWorks, Inc. <alchrist@mathworks.com> Co-authored-by: Alexander Christoforides <38366659+achristoforides@users.noreply.github.com>
Signed-off-by: The MathWorks, Inc. alchrist@mathworks.com