From: Niki Roo Date: Sat, 25 Apr 2020 19:02:36 +0000 (+0200) Subject: deadlock-fix X-Git-Tag: fanfix-swing-1.0.0~34 X-Git-Url: https://git.nikiroo.be/?a=commitdiff_plain;h=dadd24a9dee823cade4dd1467f110749f9a4191b;p=fanfix-swing.git deadlock-fix --- diff --git a/src/be/nikiroo/fanfix/library/LocalLibrary.java b/src/be/nikiroo/fanfix/library/LocalLibrary.java index 3cf5a25b..aec89721 100644 --- a/src/be/nikiroo/fanfix/library/LocalLibrary.java +++ b/src/be/nikiroo/fanfix/library/LocalLibrary.java @@ -637,10 +637,13 @@ public class LocalLibrary extends BasicLibrary { } Map stories = this.stories; - synchronized (lock) { - if (stories == null) { - stories = getStoriesDo(pg); - this.stories = stories; + if (stories == null) { + stories = getStoriesDo(pg); + synchronized (lock) { + if (this.stories == null) + this.stories = stories; + else + stories = this.stories; } }