dawn_wire: Fix leak in Server::DoDevicePopErrorScope

Also fixes a uint64_t -> uint32_t narrowing conversion.

Bug: chromium:1001045, dawn:153
Change-Id: I0f94d201884071325c7c5bb40a8c9c67c066e251
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/10980
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
This commit is contained in:
Austin Eng 2019-09-09 09:41:28 +00:00 committed by Commit Bot service account
parent 77f091ce46
commit abec145b04
2 changed files with 6 additions and 2 deletions

View File

@ -36,7 +36,7 @@ namespace dawn_wire { namespace server {
Server* server;
// TODO(enga): ObjectHandle device;
// when the wire supports multiple devices.
uint32_t requestSerial;
uint64_t requestSerial;
};
struct FenceCompletionUserdata {

View File

@ -36,7 +36,11 @@ namespace dawn_wire { namespace server {
userdata->server = this;
userdata->requestSerial = requestSerial;
return mProcs.devicePopErrorScope(cDevice, ForwardPopErrorScope, userdata);
bool success = mProcs.devicePopErrorScope(cDevice, ForwardPopErrorScope, userdata);
if (!success) {
delete userdata;
}
return success;
}
// static