From a7b41a964afdb7af37e0bb863d8116ef66f23be8 Mon Sep 17 00:00:00 2001 From: beveloper Date: Fri, 4 Oct 2002 01:45:11 +0000 Subject: [PATCH] fixed memory leak git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1364 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/kits/media/MediaRoster.cpp | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/src/kits/media/MediaRoster.cpp b/src/kits/media/MediaRoster.cpp index 8a1dc14eab..e7a85c5b47 100644 --- a/src/kits/media/MediaRoster.cpp +++ b/src/kits/media/MediaRoster.cpp @@ -158,6 +158,7 @@ PublishOutputs(const media_node & node, Stack *stack) media_output *output; media_output *outputs; int32 count; + status_t rv; count = stack->CountItems(); TRACE("PublishOutputs: publishing %ld\n", count); @@ -185,7 +186,12 @@ PublishOutputs(const media_node & node, Stack *stack) outputs[i] = *output; } - return QueryServer(SERVER_PUBLISH_OUTPUTS, &request, sizeof(request), &reply, sizeof(reply)); + rv = QueryServer(SERVER_PUBLISH_OUTPUTS, &request, sizeof(request), &reply, sizeof(reply)); + + if (request.area != -1) + delete_area(request.area); + + return rv; } status_t @@ -196,6 +202,7 @@ PublishInputs(const media_node & node, Stack *stack) media_input *input; media_input *inputs; int32 count; + status_t rv; count = stack->CountItems(); TRACE("PublishInputs: publishing %ld\n", count); @@ -223,7 +230,12 @@ PublishInputs(const media_node & node, Stack *stack) inputs[i] = *input; } - return QueryServer(SERVER_PUBLISH_INPUTS, &request, sizeof(request), &reply, sizeof(reply)); + rv = QueryServer(SERVER_PUBLISH_INPUTS, &request, sizeof(request), &reply, sizeof(reply)); + + if (request.area != -1) + delete_area(request.area); + + return rv; } } } } // namespace BPrivate::media::mediaroster