Skip to content

Commit

Permalink
Fix app shutdown
Browse files Browse the repository at this point in the history
  • Loading branch information
Lauriichan committed Jun 23, 2022
1 parent d3d11aa commit 665ecf7
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 9 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>net.sourcewriters.minecraft</groupId>
<artifactId>vcompat-updater</artifactId>
<version>1.0.2</version>
<version>1.0.3</version>
<name>vCompatUpdater</name>
<distributionManagement>
<repository>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,16 +134,19 @@ public void register(CompatApp app) {

public void unregister(CompatApp app) {
String id = app.getId();
if (id == null || !isRegistered(id)) {
app.onShutdown();
app.state = AppState.NONE;
return;
}
write.lock();
try {
apps.remove(id);
if (id == null || !isRegistered(id)) {
return;
}
write.lock();
try {
apps.remove(id);
} finally {
write.unlock();
}
} finally {
write.unlock();
app.onShutdown();
app.state = AppState.NONE;
}
read.lock();
try {
Expand Down

0 comments on commit 665ecf7

Please sign in to comment.