1
0
mirror of https://github.com/danog/MadelineProto.git synced 2024-11-26 23:34:44 +01:00

Avoid GC issues

This commit is contained in:
Daniil Gentili 2023-09-06 23:00:50 +02:00
parent 6b4d9e2233
commit 36d5bd8bc4

View File

@ -47,7 +47,7 @@ class MyEventHandler extends SimpleEventHandler
public function convertCmd((Incoming&Message&HasAudio)|(Incoming&Message&HasDocument) $message): void
{
$reply = $message->reply("Conversion in progress...");
try {
async(function () use ($message, $reply) {
$pipe = self::getStreamPipe();
$sink = $pipe->getSink();
async(
@ -62,9 +62,7 @@ class MyEventHandler extends SimpleEventHandler
fileName: $message->media->fileName.".ogg",
replyToMsgId: $message->id
);
} finally {
$reply->delete();
}
})->finally($reply->delete(...));
}
}