Skip to content

Commit

Permalink
Make RegistryExportableRegistry thread-safe
Browse files Browse the repository at this point in the history
This fixes rare crashes at startup

Closes CyclopsMC/IntegratedDynamics#1360
  • Loading branch information
rubensworks committed Jul 21, 2024
1 parent 88a8407 commit 8002d0c
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

import java.io.IOException;
import java.nio.file.Path;
import java.util.Collections;
import java.util.List;

/**
Expand All @@ -18,7 +19,7 @@ public class RegistryExportableRegistry implements IRegistryExportableRegistry {

public static final RegistryExportableRegistry INSTANCE = new RegistryExportableRegistry();

private final List<IRegistryExportable> exportables = Lists.newArrayList();
private final List<IRegistryExportable> exportables = Collections.synchronizedList(Lists.newArrayList());

private RegistryExportableRegistry() {

Expand Down

0 comments on commit 8002d0c

Please sign in to comment.