diff --git a/package.json b/package.json index 9fcd5be..4dbaf74 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "swordfish", "productName": "Swordfish", - "version": "5.2.0", + "version": "5.2.1", "description": "Swordfish Translation Editor", "main": "js/Swordfish.js", "scripts": { @@ -20,8 +20,8 @@ "url": "https://github.com/rmraya/Swordfish.git" }, "devDependencies": { - "electron": "^29.1.5", - "typescript": "^5.4.3" + "electron": "^29.3.0", + "typescript": "^5.4.5" }, "dependencies": { "mtengines": "^1.3.3", diff --git a/src/com/maxprograms/swordfish/Constants.java b/src/com/maxprograms/swordfish/Constants.java index 04d46f8..50fc9d8 100644 --- a/src/com/maxprograms/swordfish/Constants.java +++ b/src/com/maxprograms/swordfish/Constants.java @@ -19,8 +19,8 @@ private Constants() { } public static final String APPNAME = "Swordfish"; - public static final String VERSION = "5.2.0"; - public static final String BUILD = "20240325_1937"; + public static final String VERSION = "5.2.1"; + public static final String BUILD = "20240411_0935"; public static final String REASON = "reason"; public static final String STATUS = "status"; diff --git a/src/com/maxprograms/swordfish/TmsServer.java b/src/com/maxprograms/swordfish/TmsServer.java index 6d0ce88..978c545 100644 --- a/src/com/maxprograms/swordfish/TmsServer.java +++ b/src/com/maxprograms/swordfish/TmsServer.java @@ -48,6 +48,16 @@ public class TmsServer implements HttpHandler { public TmsServer(Integer port) throws IOException { server = HttpServer.create(new InetSocketAddress(port), 0); + Thread closeHook = new Thread(() -> { + try { + ProjectsHandler.closeAll(); + MemoriesHandler.closeAll(); + GlossariesHandler.closeAll(); + } catch (SQLException | IOException | URISyntaxException e) { + logger.log(Level.ERROR, e); + } + }); + Runtime.getRuntime().addShutdownHook(closeHook); } public static void main(String[] args) {