diff options
author | ivanmorozov <ivanmorozov@yandex-team.com> | 2023-06-30 08:58:55 +0300 |
---|---|---|
committer | ivanmorozov <ivanmorozov@yandex-team.com> | 2023-06-30 08:58:55 +0300 |
commit | 4151a49ff0f7a9c3eab84ccaf38d2a0ab64c189f (patch) | |
tree | 3a894abc451a14c724c45cf8162b873f9557dfb6 | |
parent | 1f2a1e3c1af40738257f006266e713915af019be (diff) | |
download | ydb-4151a49ff0f7a9c3eab84ccaf38d2a0ab64c189f.tar.gz |
deallocation on destroy
-rw-r--r-- | library/cpp/actors/core/executor_thread.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/library/cpp/actors/core/executor_thread.cpp b/library/cpp/actors/core/executor_thread.cpp index 31b1362cbf..226108a9c8 100644 --- a/library/cpp/actors/core/executor_thread.cpp +++ b/library/cpp/actors/core/executor_thread.cpp @@ -152,11 +152,13 @@ namespace NActors { bool firstEvent = true; bool preempted = false; for (; Ctx.ExecutedEvents < Ctx.EventsPerMailbox; ++Ctx.ExecutedEvents) { - if (TAutoPtr<IEventHandle> ev = mailbox->Pop()) { + if (TAutoPtr<IEventHandle> evExt = mailbox->Pop()) { NHPTimer::STime hpnow; - recipient = ev->GetRecipientRewrite(); + recipient = evExt->GetRecipientRewrite(); TActorContext ctx(*mailbox, *this, hpprev, recipient); TlsActivationContext = &ctx; // ensure dtor (if any) is called within actor system + // move for destruct before ctx; + auto ev = std::move(evExt); if (actor = mailbox->FindActor(recipient.LocalId())) { // Since actor is not null there should be no exceptions |