mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-12-09 05:05:20 -05:00
dircache: don't unpin invalid buflib handle when building volumes
Buflib pinning was introduced here in 1718cf5.
If the device has to immediately shut down after booting
because of a low battery, the directory cache may be disabled
by the time core_unpin() is reached.
Its handle will have been reset to 0 in that case, triggering
a panic message due to an invalid buflib handle.
Change-Id: Ie34c3f7142d8406b66277ef185bc9ecf387d7295
This commit is contained in:
parent
34361c82f1
commit
53e7176196
1 changed files with 2 additions and 1 deletions
|
|
@ -1882,7 +1882,8 @@ static void build_volumes(void)
|
||||||
|
|
||||||
logf("Done, %ld KiB used", dircache.size / 1024);
|
logf("Done, %ld KiB used", dircache.size / 1024);
|
||||||
|
|
||||||
core_unpin(dircache_runinfo.handle);
|
if (dircache_runinfo.handle > 0) /* dircache may have been disabled */
|
||||||
|
core_unpin(dircache_runinfo.handle);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue