mirror of
https://github.com/magefree/mage.git
synced 2025-12-23 20:11:59 -08:00
remove dangerous instance of double-checked locking
This commit is contained in:
parent
ea7c75cb52
commit
6debe066f1
1 changed files with 5 additions and 9 deletions
|
|
@ -45,16 +45,12 @@ public class ArrowBuilder {
|
|||
* Get the panel where all arrows are being drawn.
|
||||
* @return
|
||||
*/
|
||||
public JPanel getArrowsManagerPanel() {
|
||||
public synchronized JPanel getArrowsManagerPanel() {
|
||||
if (arrowsManagerPanel == null) {
|
||||
synchronized (ArrowBuilder.class) {
|
||||
if (arrowsManagerPanel == null) {
|
||||
arrowsManagerPanel = new JPanel();
|
||||
arrowsManagerPanel.setVisible(true);
|
||||
arrowsManagerPanel.setOpaque(false);
|
||||
arrowsManagerPanel.setLayout(null);
|
||||
}
|
||||
}
|
||||
arrowsManagerPanel = new JPanel();
|
||||
arrowsManagerPanel.setVisible(true);
|
||||
arrowsManagerPanel.setOpaque(false);
|
||||
arrowsManagerPanel.setLayout(null);
|
||||
}
|
||||
return arrowsManagerPanel;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue