Skip to content

Commit

Permalink
Fix behavior of and memory leak from getAllElements functions.
Browse files Browse the repository at this point in the history
The sublist wasn't being deleted, and its contents weren't being transferred.
  • Loading branch information
luciansmith committed Sep 12, 2024
1 parent 2ef3a2a commit 45eab94
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -789,6 +789,8 @@ ListOfGlobalRenderInformation::getAllElements(ElementFilter* filter)
{
List* ret = new List();
List* sublist = ListOf::getAllElements(filter);
ret->transferFrom(sublist);
delete sublist;

ADD_FILTERED_POINTER(ret, sublist, mDefaultValues, filter);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -760,6 +760,8 @@ ListOfLocalRenderInformation::getAllElements(ElementFilter* filter)
{
List* ret = new List();
List* sublist = ListOf::getAllElements(filter);
ret->transferFrom(sublist);
delete sublist;

ADD_FILTERED_POINTER(ret, sublist, mDefaultValues, filter);

Expand Down

0 comments on commit 45eab94

Please sign in to comment.