Skip to content

Commit

Permalink
fix: remove background queue cause app will crash
Browse files Browse the repository at this point in the history
  • Loading branch information
phucledien committed Aug 11, 2024
1 parent 28db709 commit 88b41ee
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
4 changes: 2 additions & 2 deletions HappyHackingKeystroke.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@
"@executable_path/../Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 11.0;
MARKETING_VERSION = 1.1.1;
MARKETING_VERSION = 1.1.2;
PRODUCT_BUNDLE_IDENTIFIER = com.oliverle.HappyHackingKeystroke;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_EMIT_LOC_STRINGS = YES;
Expand Down Expand Up @@ -340,7 +340,7 @@
"@executable_path/../Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 11.0;
MARKETING_VERSION = 1.1.1;
MARKETING_VERSION = 1.1.2;
PRODUCT_BUNDLE_IDENTIFIER = com.oliverle.HappyHackingKeystroke;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_EMIT_LOC_STRINGS = YES;
Expand Down
7 changes: 2 additions & 5 deletions HappyHackingKeystroke/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ class AppDelegate: NSObject, NSApplicationDelegate {
lastKeycode = keycode
}

private let queue = DispatchQueue(label: "keystroke sound", qos: .userInteractive)
private func playSound(file:String, ext:String) -> Void {
guard let url = Bundle.main.url(forResource: file, withExtension: ext) else {
return
Expand Down Expand Up @@ -97,10 +96,8 @@ class AppDelegate: NSObject, NSApplicationDelegate {
return
}

queue.async {
audioPlayer.stop()
audioPlayer.play()
}
audioPlayer.stop()
audioPlayer.play()
}
}

Expand Down

0 comments on commit 88b41ee

Please sign in to comment.