mirror of
https://github.com/overcuriousity/autopsy-flatpak.git
synced 2025-07-13 00:16:16 +00:00
fix race condition likely causing null ptr exception when registering a listener.
Fixes #218
This commit is contained in:
parent
da6943426b
commit
cdfe03290f
@ -31,9 +31,9 @@ import javax.swing.event.DocumentListener;
|
|||||||
* ImageTypePanel for adding an image file such as .img, .E0x, .00x, etc.
|
* ImageTypePanel for adding an image file such as .img, .E0x, .00x, etc.
|
||||||
*/
|
*/
|
||||||
public class ImageFilePanel extends ContentTypePanel implements DocumentListener {
|
public class ImageFilePanel extends ContentTypePanel implements DocumentListener {
|
||||||
private static ImageFilePanel instance;
|
private static volatile ImageFilePanel instance = null;
|
||||||
private PropertyChangeSupport pcs = new PropertyChangeSupport(this);
|
private final PropertyChangeSupport pcs = new PropertyChangeSupport(this);
|
||||||
private JFileChooser fc = new JFileChooser();
|
private final JFileChooser fc = new JFileChooser();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates new form ImageFilePanel
|
* Creates new form ImageFilePanel
|
||||||
@ -53,7 +53,7 @@ public class ImageFilePanel extends ContentTypePanel implements DocumentListener
|
|||||||
/**
|
/**
|
||||||
* Returns the default instance of a ImageFilePanel.
|
* Returns the default instance of a ImageFilePanel.
|
||||||
*/
|
*/
|
||||||
public static ImageFilePanel getDefault() {
|
public static synchronized ImageFilePanel getDefault() {
|
||||||
if (instance == null) {
|
if (instance == null) {
|
||||||
instance = new ImageFilePanel();
|
instance = new ImageFilePanel();
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user