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
Found this via Valgrind:
VBitmap make_surface( size_t width, size_t height, VBitmap::Format format = VBitmap::Format::ARGB32_Premultiplied) { if (mCache.empty()) return {width, height, format}; auto surface = mCache.back(); surface.reset(width, height, format); mCache.pop_back(); return surface; } void release_surface(VBitmap &surface) { mCache.push_back(surface); }
Here we have the sequence:
VBitmap & surface = mCache.back()
cache.pop_back();
return surface;
Instead of auto surface here, it should be VBitmap surface since auto resolve to a reference (vector::back() returns a reference on its last element)
auto surface
VBitmap surface
vector::back()
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Found this via Valgrind:
Here we have the sequence:
VBitmap & surface = mCache.back()
=> we take a reference on the last elementcache.pop_back();
=> delete the last element in the vectorreturn surface;
=> return a dangling reference on a deleted elementInstead of
auto surface
here, it should beVBitmap surface
since auto resolve to a reference (vector::back()
returns a reference on its last element)The text was updated successfully, but these errors were encountered: