[mlir][python] Use a named object

Currently, the object would be immediately destroyed after creation.
Found by ClangTidy bugprone-unused-raii.
This commit is contained in:
Adrian Kuegel 2022-01-07 13:22:32 +01:00
parent 2648e2d5dd
commit babad7c566
1 changed files with 1 additions and 1 deletions

View File

@ -140,7 +140,7 @@ public:
MlirStringCallback getCallback() { MlirStringCallback getCallback() {
return [](MlirStringRef part, void *userData) { return [](MlirStringRef part, void *userData) {
pybind11::gil_scoped_acquire(); pybind11::gil_scoped_acquire acquire;
PyFileAccumulator *accum = static_cast<PyFileAccumulator *>(userData); PyFileAccumulator *accum = static_cast<PyFileAccumulator *>(userData);
if (accum->binary) { if (accum->binary) {
// Note: Still has to copy and not avoidable with this API. // Note: Still has to copy and not avoidable with this API.