device: do not attach finalizer to non-returned object
Before, the code attached a finalizer to an object that wasn't returned, resulting in immediate garbage collection. Instead return the actual pointer. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
This commit is contained in:
parent
4b5d15ec2b
commit
6ac1240821
5 changed files with 22 additions and 20 deletions
|
|
@ -80,4 +80,4 @@ func BenchmarkWaitPool(b *testing.B) {
|
|||
}()
|
||||
}
|
||||
wg.Wait()
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue