Skip to content

Commit 2e9cb36

Browse files
Copybara Botchristopherbate
authored andcommitted
[compiler] Fix CompilerClient CAPI destroy function
Fixes an issue where the `mtrtCompilerClientDestroy` function was not correctly destroying the underlying C++ CompilerClient object. GitOrigin-RevId: 39362fcb2fc2bf8233b4695fed5e6a3944cdf606
1 parent 718ded6 commit 2e9cb36

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

mlir-tensorrt/compiler/lib/CAPI/Compiler/Compiler.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,12 +90,12 @@ MTRT_Status mtrtCompilerClientCreate(MlirContext context,
9090
if (!cppClient.isOk())
9191
return wrap(cppClient.getStatus());
9292

93-
*client = MTRT_CompilerClient{cppClient->release()};
93+
*client = wrap(cppClient->release());
9494
return mtrtStatusGetOk();
9595
}
9696

9797
MTRT_Status mtrtCompilerClientDestroy(MTRT_CompilerClient client) {
98-
delete reinterpret_cast<MTRT_CompilerClient *>(client.ptr);
98+
delete unwrap(client);
9999
return mtrtStatusGetOk();
100100
}
101101

0 commit comments

Comments
 (0)