aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--main.go13
1 files changed, 10 insertions, 3 deletions
diff --git a/main.go b/main.go
index c3ccf11..706e0a7 100644
--- a/main.go
+++ b/main.go
@@ -107,6 +107,8 @@ func main() {
os.Exit(1)
}
+ ctx.paClient = paClient
+
if list {
fmt.Println("Sources:")
sources := getSources(paClient)
@@ -133,12 +135,15 @@ func main() {
}
if unload {
- unloadSupressor(&ctx)
+ err := unloadSupressor(&ctx)
+ if err != nil {
+ fmt.Fprintf(os.Stderr, "Error unloading PulseAudio Module: %+v\n", err)
+ os.Exit(1)
+ }
os.Exit(0)
}
if loadInput {
- ctx.paClient = paClient
sources := getSources(paClient)
if sinkName == "" {
@@ -165,7 +170,6 @@ func main() {
}
if loadOutput {
- ctx.paClient = paClient
sinks := getSinks(paClient)
if sinkName == "" {
@@ -192,6 +196,9 @@ func main() {
}
+ ctx.paClient.Close()
+ ctx.paClient = nil
+
if ctx.config.EnableUpdates {
go updateCheck(&ctx)
}