refresh neither leaks wraps, allows 2 of the same at once, nor closes raws
This commit is contained in:
@@ -3,6 +3,7 @@ package wrap
|
||||
import (
|
||||
"context"
|
||||
"mayhem-party/src/device/input/button"
|
||||
"mayhem-party/src/device/input/raw"
|
||||
"os"
|
||||
)
|
||||
|
||||
@@ -15,6 +16,7 @@ var (
|
||||
type Wrap interface {
|
||||
Read() []button.Button
|
||||
Close()
|
||||
CloseWrap() raw.Raw
|
||||
}
|
||||
|
||||
func New(ctx context.Context, srcFunc func() button.Parser) Wrap {
|
||||
@@ -36,7 +38,7 @@ func New(ctx context.Context, srcFunc func() button.Parser) Wrap {
|
||||
if FlagRefreshOnSigUsr1 {
|
||||
oldMaker := maker
|
||||
maker = func() Wrap {
|
||||
return NewRefresh(oldMaker)
|
||||
return NewRefresh(ctx, oldMaker)
|
||||
}
|
||||
}
|
||||
return maker()
|
||||
|
||||
Reference in New Issue
Block a user