IORequests leaked their IOBuffers.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26742 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Ingo Weinhold
2008-08-02 20:51:59 +00:00
parent c421c138b6
commit 7cc9a52df8
2 changed files with 10 additions and 0 deletions
@@ -65,6 +65,13 @@ IOBuffer::Create(size_t count)
} }
void
IOBuffer::Delete()
{
free(this);
}
void void
IOBuffer::SetVecs(size_t firstVecOffset, const iovec* vecs, uint32 count, IOBuffer::SetVecs(size_t firstVecOffset, const iovec* vecs, uint32 count,
size_t length, uint32 flags) size_t length, uint32 flags)
@@ -508,6 +515,7 @@ IORequest::~IORequest()
{ {
mutex_lock(&fLock); mutex_lock(&fLock);
DeleteSubRequests(); DeleteSubRequests();
fBuffer->Delete();
mutex_destroy(&fLock); mutex_destroy(&fLock);
} }
@@ -29,6 +29,7 @@ typedef struct IOOperation io_operation;
class IOBuffer : public DoublyLinkedListLinkImpl<IOBuffer> { class IOBuffer : public DoublyLinkedListLinkImpl<IOBuffer> {
public: public:
static IOBuffer* Create(size_t count); static IOBuffer* Create(size_t count);
void Delete();
bool IsVirtual() const { return !fPhysical; } bool IsVirtual() const { return !fPhysical; }
bool IsPhysical() const { return fPhysical; } bool IsPhysical() const { return fPhysical; }
@@ -55,6 +56,7 @@ public:
void UnlockMemory(team_id team, bool isWrite); void UnlockMemory(team_id team, bool isWrite);
private: private:
IOBuffer();
~IOBuffer(); ~IOBuffer();
// not implemented // not implemented
void _UnlockMemory(team_id team, size_t count, void _UnlockMemory(team_id team, size_t count,