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
caf7585a
Commit
caf7585a
authored
3 years ago
by
Rye Mutt
Browse files
Options
Downloads
Patches
Plain Diff
Fix crash on diskcache purge
parent
ab186580
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
indra/llfilesystem/lldiskcache.cpp
+34
-25
34 additions, 25 deletions
indra/llfilesystem/lldiskcache.cpp
with
34 additions
and
25 deletions
indra/llfilesystem/lldiskcache.cpp
+
34
−
25
View file @
caf7585a
...
@@ -113,7 +113,10 @@ void LLDiskCache::purge()
...
@@ -113,7 +113,10 @@ void LLDiskCache::purge()
#endif
#endif
if
(
boost
::
filesystem
::
is_directory
(
cache_path
,
ec
)
&&
!
ec
.
failed
())
if
(
boost
::
filesystem
::
is_directory
(
cache_path
,
ec
)
&&
!
ec
.
failed
())
{
{
for
(
auto
&
entry
:
boost
::
make_iterator_range
(
boost
::
filesystem
::
recursive_directory_iterator
(
cache_path
),
{}))
boost
::
filesystem
::
recursive_directory_iterator
dir_iter
(
cache_path
,
ec
);
if
(
!
ec
.
failed
())
{
for
(
auto
&
entry
:
boost
::
make_iterator_range
(
dir_iter
,
{}))
{
{
ec
.
clear
();
ec
.
clear
();
if
(
boost
::
filesystem
::
is_regular_file
(
entry
,
ec
)
&&
!
ec
.
failed
())
if
(
boost
::
filesystem
::
is_regular_file
(
entry
,
ec
)
&&
!
ec
.
failed
())
...
@@ -138,6 +141,7 @@ void LLDiskCache::purge()
...
@@ -138,6 +141,7 @@ void LLDiskCache::purge()
}
}
}
}
}
}
}
std
::
sort
(
file_info
.
begin
(),
file_info
.
end
(),
[](
const
file_info_t
&
x
,
const
file_info_t
&
y
)
std
::
sort
(
file_info
.
begin
(),
file_info
.
end
(),
[](
const
file_info_t
&
x
,
const
file_info_t
&
y
)
{
{
...
@@ -176,6 +180,7 @@ void LLDiskCache::purge()
...
@@ -176,6 +180,7 @@ void LLDiskCache::purge()
if
(
ec
.
failed
())
if
(
ec
.
failed
())
{
{
LL_WARNS
()
<<
"Failed to delete cache file "
<<
entry
.
second
.
second
<<
": "
<<
ec
.
message
()
<<
LL_ENDL
;
LL_WARNS
()
<<
"Failed to delete cache file "
<<
entry
.
second
.
second
<<
": "
<<
ec
.
message
()
<<
LL_ENDL
;
continue
;
}
}
}
}
}
}
...
@@ -414,7 +419,10 @@ uintmax_t LLDiskCache::dirFileSize(const std::string dir)
...
@@ -414,7 +419,10 @@ uintmax_t LLDiskCache::dirFileSize(const std::string dir)
#endif
#endif
if
(
boost
::
filesystem
::
is_directory
(
dir_path
,
ec
)
&&
!
ec
.
failed
())
if
(
boost
::
filesystem
::
is_directory
(
dir_path
,
ec
)
&&
!
ec
.
failed
())
{
{
for
(
auto
&
entry
:
boost
::
make_iterator_range
(
boost
::
filesystem
::
recursive_directory_iterator
(
dir_path
),
{}))
boost
::
filesystem
::
recursive_directory_iterator
dir_iter
(
dir_path
,
ec
);
if
(
!
ec
.
failed
())
{
for
(
auto
&
entry
:
boost
::
make_iterator_range
(
dir_iter
,
{}))
{
{
ec
.
clear
();
ec
.
clear
();
if
(
boost
::
filesystem
::
is_regular_file
(
entry
,
ec
)
&&
!
ec
.
failed
())
if
(
boost
::
filesystem
::
is_regular_file
(
entry
,
ec
)
&&
!
ec
.
failed
())
...
@@ -432,6 +440,7 @@ uintmax_t LLDiskCache::dirFileSize(const std::string dir)
...
@@ -432,6 +440,7 @@ uintmax_t LLDiskCache::dirFileSize(const std::string dir)
}
}
}
}
}
}
}
return
total_file_size
;
return
total_file_size
;
}
}
...
...
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