Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Alchemy Viewer
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Package registry
Operate
Terraform modules
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Silent mode is enabled
All outbound communications are blocked.
Learn more
.
Show more breadcrumbs
Alchemy Viewer
Alchemy Viewer
Commits
589a1671
Commit
589a1671
authored
2 years ago
by
Rye Mutt
Browse files
Options
Downloads
Patches
Plain Diff
Fix leak of LLFolderViewModel sorter and filter with unique_ptr
parent
5326e3a2
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
indra/llui/llfolderviewmodel.h
+5
-11
5 additions, 11 deletions
indra/llui/llfolderviewmodel.h
with
5 additions
and
11 deletions
indra/llui/llfolderviewmodel.h
+
5
−
11
View file @
589a1671
...
@@ -419,21 +419,15 @@ class LLFolderViewModel : public LLFolderViewModelCommon
...
@@ -419,21 +419,15 @@ class LLFolderViewModel : public LLFolderViewModelCommon
mFilter
(
filter
)
mFilter
(
filter
)
{}
{}
virtual
~
LLFolderViewModel
()
virtual
~
LLFolderViewModel
()
{}
{
delete
mSorter
;
mSorter
=
NULL
;
delete
mFilter
;
mFilter
=
NULL
;
}
virtual
SortType
&
getSorter
()
{
return
*
mSorter
;
}
virtual
SortType
&
getSorter
()
{
return
*
mSorter
;
}
virtual
const
SortType
&
getSorter
()
const
{
return
*
mSorter
;
}
virtual
const
SortType
&
getSorter
()
const
{
return
*
mSorter
;
}
virtual
void
setSorter
(
const
SortType
&
sorter
)
{
mSorter
=
new
SortType
(
sorter
);
requestSortAll
();
}
virtual
void
setSorter
(
const
SortType
&
sorter
)
{
mSorter
.
reset
(
new
SortType
(
sorter
)
)
;
requestSortAll
();
}
virtual
FilterType
&
getFilter
()
{
return
*
mFilter
;
}
virtual
FilterType
&
getFilter
()
{
return
*
mFilter
;
}
virtual
const
FilterType
&
getFilter
()
const
{
return
*
mFilter
;
}
virtual
const
FilterType
&
getFilter
()
const
{
return
*
mFilter
;
}
virtual
void
setFilter
(
const
FilterType
&
filter
)
{
mFilter
=
new
FilterType
(
filter
);
}
virtual
void
setFilter
(
const
FilterType
&
filter
)
{
mFilter
.
reset
(
new
FilterType
(
filter
)
)
;
}
// By default, we assume the content is available. If a network fetch mechanism is implemented for the model,
// By default, we assume the content is available. If a network fetch mechanism is implemented for the model,
// this method needs to be overloaded and return the relevant fetch status.
// this method needs to be overloaded and return the relevant fetch status.
...
@@ -471,8 +465,8 @@ class LLFolderViewModel : public LLFolderViewModelCommon
...
@@ -471,8 +465,8 @@ class LLFolderViewModel : public LLFolderViewModelCommon
}
}
protected
:
protected
:
SortType
*
mSorter
;
std
::
unique_ptr
<
SortType
>
mSorter
;
FilterType
*
mFilter
;
std
::
unique_ptr
<
FilterType
>
mFilter
;
};
};
#endif // LLFOLDERVIEWMODEL_H
#endif // LLFOLDERVIEWMODEL_H
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment