Clear stops tracking all the managed pointers.
()
| 46 | |
| 47 | // Clear stops tracking all the managed pointers. |
| 48 | func (v *HandleList) Clear() { |
| 49 | v.Lock() |
| 50 | for handle := range v.handles { |
| 51 | delete(v.handles, handle) |
| 52 | C.free(handle) |
| 53 | } |
| 54 | v.Unlock() |
| 55 | } |
| 56 | |
| 57 | // Get retrieves the pointer from the given handle |
| 58 | func (v *HandleList) Get(handle unsafe.Pointer) interface{} { |