We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 222a56a commit 1b15ea8Copy full SHA for 1b15ea8
1 file changed
app/src/processing/app/Language.java
@@ -43,7 +43,7 @@ public class Language {
43
static protected final File prefFile = Base.getSettingsFile(PREF_FILE);
44
45
/** Single instance of this Language class */
46
- static private Language instance = null;
+ static private volatile Language instance;
47
48
/** The system language */
49
private String language;
@@ -149,9 +149,13 @@ static public void saveLanguage(String language) {
149
150
151
/** Singleton constructor */
152
- static public synchronized Language init() {
+ static public Language init() {
153
if (instance == null) {
154
- instance = new Language();
+ synchronized(Language.class) {
155
+ if (instance == null) {
156
+ instance = new Language();
157
+ }
158
159
}
160
return instance;
161
0 commit comments