We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
It seems the generated object assignment operator doesn't increase the reference count of the underlying Obj.
For example, this is the generated assignment operator:
Hit& Hit::operator=(const Hit& other) { if ( m_obj != nullptr) m_obj->release(); m_obj = other.m_obj; return *this; }
And some code like this would cause problems:
std::map<int,Hit> HitMap; for(...) { Hit aHit = Hit(); ... HitMap[i] = aHit; }// Hits in the HitMap becomes invalid after the loop.
Is this by design or unexpected? Maybe add a m_obj->acquire() as well.
The text was updated successfully, but these errors were encountered:
Hi @feipengsy,
thanks for reporting this. This is indeed a bug and the assignment operator should acquire to increase the reference count.
acquire
Sorry, something went wrong.
Successfully merging a pull request may close this issue.
It seems the generated object assignment operator doesn't increase the reference count of the underlying Obj.
For example, this is the generated assignment operator:
And some code like this would cause problems:
Is this by design or unexpected? Maybe add a m_obj->acquire() as well.
The text was updated successfully, but these errors were encountered: