mirror of
https://github.com/saymrwulf/onnxruntime.git
synced 2026-06-04 23:59:56 +00:00
[js/webgpu] resolve codescan alert (#19343)
### Description resolve codescan alert: https://github.com/microsoft/onnxruntime/security/code-scanning/17687
This commit is contained in:
parent
d73131cf0f
commit
dd1f6ccc45
1 changed files with 5 additions and 7 deletions
|
|
@ -705,13 +705,11 @@ export class WebGpuBackend {
|
|||
|
||||
captureBegin(): void {
|
||||
LOG_DEBUG('info', 'captureBegin');
|
||||
let sessionCommandList = this.capturedCommandList.get(this.currentSessionId!);
|
||||
let sessionPendingKernels = this.capturedPendingKernels.get(this.currentSessionId!);
|
||||
if (!sessionCommandList) {
|
||||
sessionCommandList = [];
|
||||
this.capturedCommandList.set(this.currentSessionId!, sessionCommandList);
|
||||
sessionPendingKernels = [];
|
||||
this.capturedPendingKernels.set(this.currentSessionId!, sessionPendingKernels);
|
||||
if (!this.capturedCommandList.get(this.currentSessionId!)) {
|
||||
this.capturedCommandList.set(this.currentSessionId!, []);
|
||||
}
|
||||
if (!this.capturedPendingKernels.get(this.currentSessionId!)) {
|
||||
this.capturedPendingKernels.set(this.currentSessionId!, []);
|
||||
}
|
||||
// flush the left commands before we change the status.
|
||||
this.flush();
|
||||
|
|
|
|||
Loading…
Reference in a new issue