summaryrefslogtreecommitdiffhomepage
path: root/pkg/sentry/fs/tty/terminal.go
diff options
context:
space:
mode:
authorIan Gudger <igudger@google.com>2019-06-28 20:06:33 -0700
committergVisor bot <gvisor-bot@google.com>2019-06-28 20:07:52 -0700
commit45566fa4e4bc55e870ae1d7f80778be8432bdef5 (patch)
tree9b9064ef22a6f34ade4714cc90ad0573440c3e1c /pkg/sentry/fs/tty/terminal.go
parent7dae043fecc109d7a0ae1d5d6274e48b1bf04d13 (diff)
Add finalizer on AtomicRefCount to check for leaks.
PiperOrigin-RevId: 255711454
Diffstat (limited to 'pkg/sentry/fs/tty/terminal.go')
-rw-r--r--pkg/sentry/fs/tty/terminal.go4
1 files changed, 3 insertions, 1 deletions
diff --git a/pkg/sentry/fs/tty/terminal.go b/pkg/sentry/fs/tty/terminal.go
index 8290f2530..b7cecb2ed 100644
--- a/pkg/sentry/fs/tty/terminal.go
+++ b/pkg/sentry/fs/tty/terminal.go
@@ -38,9 +38,11 @@ type Terminal struct {
func newTerminal(ctx context.Context, d *dirInodeOperations, n uint32) *Terminal {
termios := linux.DefaultSlaveTermios
- return &Terminal{
+ t := Terminal{
d: d,
n: n,
ld: newLineDiscipline(termios),
}
+ t.EnableLeakCheck("tty.Terminal")
+ return &t
}