forked from dorkbox/SystemTray
Cleaned up removing menu entry, added exception throwing
This commit is contained in:
parent
19eb4df547
commit
180d66a7c1
@ -1181,6 +1181,7 @@ class SystemTray {
|
||||
@Override
|
||||
public
|
||||
void run() {
|
||||
try {
|
||||
synchronized (menuEntries) {
|
||||
for (Iterator<MenuEntry> iterator = menuEntries.iterator(); iterator.hasNext(); ) {
|
||||
final MenuEntry entry = iterator.next();
|
||||
@ -1191,13 +1192,16 @@ class SystemTray {
|
||||
// this will also reset the menu
|
||||
menuEntry.remove();
|
||||
hasValue.set(true);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
logger.error("Error removing menu entry from list.", e);
|
||||
} finally {
|
||||
countDownLatch.countDown();
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
countDownLatch.countDown();
|
||||
}
|
||||
});
|
||||
|
||||
try {
|
||||
|
Loading…
Reference in New Issue
Block a user