1
0
mirror of https://github.com/danog/MadelineProto.git synced 2024-11-27 01:14:39 +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 public function convertCmd((Incoming&Message&HasAudio)|(Incoming&Message&HasDocument) $message): void
{ {
$reply = $message->reply("Conversion in progress..."); $reply = $message->reply("Conversion in progress...");
try { async(function () use ($message, $reply) {
$pipe = self::getStreamPipe(); $pipe = self::getStreamPipe();
$sink = $pipe->getSink(); $sink = $pipe->getSink();
async( async(
@ -62,9 +62,7 @@ class MyEventHandler extends SimpleEventHandler
fileName: $message->media->fileName.".ogg", fileName: $message->media->fileName.".ogg",
replyToMsgId: $message->id replyToMsgId: $message->id
); );
} finally { })->finally($reply->delete(...));
$reply->delete();
}
} }
} }