From 6bb5dd39f2c6ab1fde64dea20e81971a5af02b65 Mon Sep 17 00:00:00 2001 From: Jamie Reece Wilson Date: Mon, 16 Oct 2023 04:03:19 +0100 Subject: [PATCH] [*] 358964ef cont: realloc event callbacks not fired --- Source/IO/AuIOPipeProcessor.cpp | 17 ++++++++++++++++- Source/IO/AuIOPipeProcessor.hpp | 1 + 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/Source/IO/AuIOPipeProcessor.cpp b/Source/IO/AuIOPipeProcessor.cpp index c034b0d9..439e4b9d 100644 --- a/Source/IO/AuIOPipeProcessor.cpp +++ b/Source/IO/AuIOPipeProcessor.cpp @@ -633,6 +633,21 @@ namespace Aurora::IO { this->uReallocs_[1]++; this->bLastReallocFail = true; + + if (auto pListener = this->request.pListener) + { + pListener->OnPipeReallocEvent(false); + } + } + + void IOPipeWork::SuccessRealloc() + { + this->uReallocs_[0]++; + + if (auto pListener = this->request.pListener) + { + pListener->OnPipeReallocEvent(true); + } } void IOPipeWork::DoReallocTick() @@ -658,7 +673,7 @@ namespace Aurora::IO } this->buffer_ = AuMove(replacement); - this->uReallocs_[0]++; + this->SuccessRealloc(); } AuByteBuffer *IOPipeWork::GetBuffer() diff --git a/Source/IO/AuIOPipeProcessor.hpp b/Source/IO/AuIOPipeProcessor.hpp index f9ae71a1..22a06c8f 100644 --- a/Source/IO/AuIOPipeProcessor.hpp +++ b/Source/IO/AuIOPipeProcessor.hpp @@ -96,6 +96,7 @@ namespace Aurora::IO void DoReallocTick(); void FailRealloc(); + void SuccessRealloc(); AuUInt GetNextFrameLength(AuUInt uBytesMax); AuUInt GetNextFrameLength2();