Skip to content

Commit ec15631

Browse files
authored
Arm backend: Fix Ethos-U handle release on platform_init() failure (pytorch#22897)
### Problem pytorch#22531 removed dynamic allocation but platform_init() failure still calls `delete`. ### Change Release the handle with the destructor `handle->~ExecutionHandle()` to follow up on pytorch#22531. Signed-off-by: Youngsik Yang <vacu9708@gmail.com>
1 parent 0c3ebaa commit ec15631

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎backends/arm/runtime/EthosUBackend.cpp‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ class EthosUBackend final : public ::executorch::runtime::BackendInterface {
146146
const Error platform_status =
147147
platform_init(compile_specs, allocator, handle);
148148
if (platform_status != Error::Ok) {
149-
delete handle;
149+
handle->~ExecutionHandle();
150150
return platform_status;
151151
}
152152

0 commit comments

Comments
 (0)