Add changes the group's reference counter by delta, which may be negative. If the reference counter becomes zero the group will be disposed of. If the reference counter goes negative Add will panic.
(delta int)
| 170 | // |
| 171 | // If the reference counter goes negative Add will panic. |
| 172 | func (g *WindowGroup) Add(delta int) { |
| 173 | if g.removed { |
| 174 | panic("walk: add() called on a WindowGroup that has been removed from its manager") |
| 175 | } |
| 176 | |
| 177 | g.refs += delta |
| 178 | if g.refs < 0 { |
| 179 | panic("walk: negative WindowGroup refs counter") |
| 180 | } |
| 181 | if g.refs-g.ignored == 0 { |
| 182 | g.dispose() |
| 183 | } |
| 184 | } |
| 185 | |
| 186 | // Done decrements the group's reference counter by one. |
| 187 | func (g *WindowGroup) Done() { |
no test coverage detected