1 parent a1ec4d4 commit bf0b237Copy full SHA for bf0b237
1 file changed
Sources/UsageBar/main.swift
@@ -436,6 +436,12 @@ extension AppDelegate {
436
437
// MARK: - Entry Point
438
439
+// Prevent multiple instances
440
+let runningInstances = NSRunningApplication.runningApplications(withBundleIdentifier: "com.usagebar")
441
+if runningInstances.count > 1 {
442
+ exit(0)
443
+}
444
+
445
let app = NSApplication.shared
446
let delegate = AppDelegate()
447
app.delegate = delegate
0 commit comments