close Writer after use which may leak mem

Signed-off-by: Zou Nengren <zouyee1989@gmail.com>
This commit is contained in:
zounengren 2021-10-12 17:25:08 +08:00
parent 6927fc3276
commit 46be069379

View File

@ -820,6 +820,7 @@ func checkCrossNSShare(ctx context.Context, t *testing.T, cs content.Store) {
if err != nil {
t.Fatal(err)
}
defer w.Close()
t2 := time.Now()
checkStatus(t, w, content.Status{
@ -878,6 +879,7 @@ func checkCrossNSAppend(ctx context.Context, t *testing.T, cs content.Store) {
if err != nil {
t.Fatal(err)
}
defer w.Close()
t2 := time.Now()
checkStatus(t, w, content.Status{
@ -940,6 +942,7 @@ func checkCrossNSIsolate(ctx context.Context, t *testing.T, cs content.Store) {
if err != nil {
t.Fatal(err)
}
defer w.Close()
t4 := time.Now()
checkNewlyCreated(t, w, t1, t2, t3, t4)