app_server: ServerMemoryAllocator takes the original area as the key.
Should fix memory leaks caused by fe8f88cff41e.
Diff
src/servers/app/ClientMemoryAllocator.cpp | 4 ++++
src/servers/app/ClientMemoryAllocator.h | 1 +
2 files changed, 4 insertions(+), 1 deletion(-)
@@ -371,6 +371,7 @@
ClonedAreaMemory::ClonedAreaMemory()
:
fArea(-1),
fClonedArea(-1),
fOffset(0),
fBase(NULL)
@@ -381,7 +382,7 @@
ClonedAreaMemory::~ClonedAreaMemory()
{
BAutolock locker(sLocker);
sClonedAreaMemoryAllocator.RemoveArea(fClonedArea);
sClonedAreaMemoryAllocator.RemoveArea(fArea);
}
@@ -392,6 +393,7 @@
if (sClonedAreaMemoryAllocator.AddArea(area, fClonedArea, fBase, 0, false) != B_OK)
return NULL;
fArea = area;
fOffset = offset;
return Address();
}
@@ -101,6 +101,7 @@
virtual uint32 AreaOffset();
private:
area_id fArea;
area_id fClonedArea;
uint32 fOffset;
uint8* fBase;