mirror of
https://github.com/sparrowwallet/sparrow.git
synced 2026-08-10 08:37:05 +00:00
safe multithreading config writes
This commit is contained in:
@@ -277,12 +277,13 @@ public class Config {
|
||||
flush();
|
||||
}
|
||||
|
||||
private void flush() {
|
||||
private synchronized void flush() {
|
||||
Gson gson = getGson();
|
||||
try {
|
||||
File configFile = getConfigFile();
|
||||
Writer writer = new FileWriter(configFile);
|
||||
gson.toJson(this, writer);
|
||||
writer.flush();
|
||||
writer.close();
|
||||
} catch (IOException e) {
|
||||
//Ignore
|
||||
|
||||
Reference in New Issue
Block a user