IncRef increments the reference count for the specified handle.
(handle CGoHandle)
| 161 | |
| 162 | // IncRef increments the reference count for the specified handle. |
| 163 | func IncRef(handle CGoHandle) { |
| 164 | if handle < 1 { |
| 165 | return |
| 166 | } |
| 167 | mu.Lock() |
| 168 | defer mu.Unlock() |
| 169 | ghc := GoHandle(handle) |
| 170 | if _, exists := counts[ghc]; exists { |
| 171 | counts[ghc]++ |
| 172 | if trace { |
| 173 | fmt.Printf("gopy IncRef: %d: %d\n", handle, counts[ghc]) |
| 174 | } |
| 175 | } |
| 176 | |
| 177 | } |
| 178 | |
| 179 | // VarFromHandle gets variable from handle string. |
| 180 | // Reports error to python but does not return it, |