diff options
| author | sabdenovch <[email protected]> | 2025-01-31 15:26:49 +0300 |
|---|---|---|
| committer | sabdenovch <[email protected]> | 2025-01-31 15:44:23 +0300 |
| commit | 84db1a13e70e60d44b341eabf9d598405a1f4bec (patch) | |
| tree | 29e7e3376b38bf21bf351ab05cfd2b738e9956bf | |
| parent | a44c39d80f6462d9ac6a75ef11a0543596bdeb4a (diff) | |
YT-24099: Fix memory leaks in cancelled selects
* Changelog entry
Type: fix
Component: dynamic-tables
Eliminate a memory leak caused by cancelled selects.
commit_hash:4e3db46a482fef077427748b6c426370b9a8922c
| -rw-r--r-- | yt/yt/client/table_client/pipe.cpp | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/yt/yt/client/table_client/pipe.cpp b/yt/yt/client/table_client/pipe.cpp index be6607b232e..fcb77361e76 100644 --- a/yt/yt/client/table_client/pipe.cpp +++ b/yt/yt/client/table_client/pipe.cpp @@ -42,10 +42,13 @@ struct TSchemafulPipe::TData void ResetReaderReadyEvent() { ReaderReadyEvent = NewPromise<void>(); - ReaderReadyEvent.OnCanceled(BIND([=, this, this_ = MakeStrong(this)] (const TError& error) { - Fail(TError(NYT::EErrorCode::Canceled, "Pipe reader canceled") - << error); - })); + ReaderReadyEvent.OnCanceled(BIND(&TSchemafulPipe::TData::HandleCancel, MakeWeak(this))); + } + + void HandleCancel(const TError& error) + { + Fail(TError(NYT::EErrorCode::Canceled, "Pipe reader canceled") + << error); } void Fail(const TError& error) |
