diff --git a/src/system/kernel/device_manager/io_requests.cpp b/src/system/kernel/device_manager/io_requests.cpp index 60b717bad4..9e574cfe42 100644 --- a/src/system/kernel/device_manager/io_requests.cpp +++ b/src/system/kernel/device_manager/io_requests.cpp @@ -65,6 +65,13 @@ IOBuffer::Create(size_t count) } +void +IOBuffer::Delete() +{ + free(this); +} + + void IOBuffer::SetVecs(size_t firstVecOffset, const iovec* vecs, uint32 count, size_t length, uint32 flags) @@ -508,6 +515,7 @@ IORequest::~IORequest() { mutex_lock(&fLock); DeleteSubRequests(); + fBuffer->Delete(); mutex_destroy(&fLock); } diff --git a/src/system/kernel/device_manager/io_requests.h b/src/system/kernel/device_manager/io_requests.h index 5a3b482a63..f80cfe104d 100644 --- a/src/system/kernel/device_manager/io_requests.h +++ b/src/system/kernel/device_manager/io_requests.h @@ -29,6 +29,7 @@ typedef struct IOOperation io_operation; class IOBuffer : public DoublyLinkedListLinkImpl { public: static IOBuffer* Create(size_t count); + void Delete(); bool IsVirtual() const { return !fPhysical; } bool IsPhysical() const { return fPhysical; } @@ -55,6 +56,7 @@ public: void UnlockMemory(team_id team, bool isWrite); private: + IOBuffer(); ~IOBuffer(); // not implemented void _UnlockMemory(team_id team, size_t count,