Commit c403ae36 authored by Han-Wen Nienhuys's avatar Han-Wen Nienhuys

Erase check when forgetting object.

parent 95b34488
......@@ -162,6 +162,7 @@ func (me *int64HandleMap) Forget(handle uint64) (val *Handled) {
me.mutex.Lock()
defer me.mutex.Unlock()
me.handles[handle] = nil, false
val.check = 0
return val
}
......
......@@ -89,6 +89,10 @@ func TestHandleMapBasic(t *testing.T) {
if hm.Has(h) {
t.Fatal("Still has handle")
}
if v.check != 0 {
t.Errorf("forgotten object still has a check.")
}
}
func TestHandleMapMultiple(t *testing.T) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment