diff options
author | Liam <byteslice@airmail.cc> | 2023-10-30 04:38:24 +0100 |
---|---|---|
committer | Liam <byteslice@airmail.cc> | 2023-10-30 04:38:24 +0100 |
commit | a872030a351cc50293e6bf0793fe70041cee0098 (patch) | |
tree | 5e88267716394ccd2d15379a02e69d74bd371916 /src/core/hle/service/nvnflinger/consumer_base.cpp | |
parent | Merge pull request #11911 from german77/leak_event (diff) | |
download | yuzu-a872030a351cc50293e6bf0793fe70041cee0098.tar yuzu-a872030a351cc50293e6bf0793fe70041cee0098.tar.gz yuzu-a872030a351cc50293e6bf0793fe70041cee0098.tar.bz2 yuzu-a872030a351cc50293e6bf0793fe70041cee0098.tar.lz yuzu-a872030a351cc50293e6bf0793fe70041cee0098.tar.xz yuzu-a872030a351cc50293e6bf0793fe70041cee0098.tar.zst yuzu-a872030a351cc50293e6bf0793fe70041cee0098.zip |
Diffstat (limited to 'src/core/hle/service/nvnflinger/consumer_base.cpp')
-rw-r--r-- | src/core/hle/service/nvnflinger/consumer_base.cpp | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/core/hle/service/nvnflinger/consumer_base.cpp b/src/core/hle/service/nvnflinger/consumer_base.cpp index 4dcda8dac..1059e72bf 100644 --- a/src/core/hle/service/nvnflinger/consumer_base.cpp +++ b/src/core/hle/service/nvnflinger/consumer_base.cpp @@ -27,6 +27,26 @@ void ConsumerBase::Connect(bool controlled_by_app) { consumer->Connect(shared_from_this(), controlled_by_app); } +void ConsumerBase::Abandon() { + LOG_DEBUG(Service_Nvnflinger, "called"); + + std::scoped_lock lock{mutex}; + + if (!is_abandoned) { + this->AbandonLocked(); + is_abandoned = true; + } +} + +void ConsumerBase::AbandonLocked() { + for (int i = 0; i < BufferQueueDefs::NUM_BUFFER_SLOTS; i++) { + this->FreeBufferLocked(i); + } + // disconnect from the BufferQueue + consumer->Disconnect(); + consumer = nullptr; +} + void ConsumerBase::FreeBufferLocked(s32 slot_index) { LOG_DEBUG(Service_Nvnflinger, "slot_index={}", slot_index); |