Skip to content

Commit

Permalink
a minimal fix for presenting issue, but several SetFinalizer time-bom…
Browse files Browse the repository at this point in the history
…bs remain. fixes apple#11856
  • Loading branch information
Jason E. Aten, Ph.D. committed Jan 1, 2025
1 parent 63035b5 commit 313fde8
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion bindings/go/src/fdb/tenant.go
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,17 @@ type Tenant struct {
db Database
}

// Close releases the local handle/resources associated
// with the tenant; it does not affect the
// tenant's existance or the data it owns at all.
// Client programs should arrange to call Close()
// when they are done with the Tenant. Often
// this can be done conveniently in a defer statement
// right after OpenTenant.
func (t *Tenant) Close() {
t.destroy()
}

type tenant struct {
ptr *C.FDBTenant
}
Expand All @@ -169,7 +180,7 @@ func (d Database) OpenTenant(name KeyConvertible) (Tenant, error) {
}

tnt := &tenant{outt}
runtime.SetFinalizer(tnt, (*tenant).destroy)
//runtime.SetFinalizer(tnt, (*tenant).destroy)

return Tenant{tnt, d}, nil
}
Expand Down

0 comments on commit 313fde8

Please sign in to comment.