Commit 2617eada by Jamie Madill Committed by Commit Bot

Cleanup to Resource11's reset method.

Only reset when the resource is valid. This will prevent a memory allocation that could happen when triggering suprious reset() calls. BUG=angleproject:1155 Change-Id: I3b9bc1f9e0542c14ed5fd4a03f82ad23c94b734b Reviewed-on: https://chromium-review.googlesource.com/659231 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: 's avatarGeoff Lang <geofflang@chromium.org>
parent 14bbb3f9
......@@ -187,7 +187,11 @@ class Resource11Base : angle::NonCopyable
bool valid() const { return (mData->object != nullptr); }
void reset() { mData.reset(new DataT()); }
void reset()
{
if (valid())
mData.reset(new DataT());
}
ResourceSerial getSerial() const
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment