mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 726382 - Ensure the mDir and mMozDir variables are protected by synchronization. r=rnewman
It is possible that two threads will call getDir(), or getDir() and moveProfilesToAppInstallLocation() simultaneously. Without this patch, this would attempt to double-create the mozilla or profile directories, which would then result in an IOException and failure when it shouldn't.
This commit is contained in:
parent
252040f7c7
commit
acdd08d8b5
@ -61,7 +61,7 @@ public final class GeckoProfile {
|
||||
mName = profileName;
|
||||
}
|
||||
|
||||
public File getDir() {
|
||||
public synchronized File getDir() {
|
||||
if (mDir != null) {
|
||||
return mDir;
|
||||
}
|
||||
@ -280,7 +280,7 @@ public final class GeckoProfile {
|
||||
return success;
|
||||
}
|
||||
|
||||
private File ensureMozillaDirectory() throws IOException {
|
||||
private synchronized File ensureMozillaDirectory() throws IOException {
|
||||
if (mMozDir != null) {
|
||||
return mMozDir;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user