Commit 09e9f097 authored by Geoffrey Métais's avatar Geoffrey Métais

Atomic update for dbManager values

CID #1226286
parent 0d6164aa
......@@ -129,10 +129,12 @@ public class BrowserActivity extends ListActivity {
public boolean onMenuItemClick(MenuItem arg0) {
// remove any checkmarks of the custom item
final MediaDatabase dbManager = MediaDatabase.getInstance();
for(File f : dbManager.getMediaDirs()) {
final String path = f.getPath();
if(path.startsWith(item.getPath()))
dbManager.removeDir(path);
synchronized (dbManager) {
for(File f : dbManager.getMediaDirs()) {
final String path = f.getPath();
if(path.startsWith(item.getPath()))
dbManager.removeDir(path);
}
}
CustomDirectories.removeCustomDirectory(item.getPath());
refresh();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment