| 150 | |
| 151 | |
| 152 | bool GfxBlock::remove(EventClient* ec) { |
| 153 | if (clients.empty()) { |
| 154 | return false; |
| 155 | } |
| 156 | EventClient* top = clients[0]; |
| 157 | bool success = false; |
| 158 | for (size_t i = 0; i < clients.size(); i++) { |
| 159 | if (clients[i] == ec) { |
| 160 | clients.erase(clients.begin() + i); |
| 161 | success = true; |
| 162 | i--; |
| 163 | } |
| 164 | } |
| 165 | if (!clients.empty() && (clients[0] != top)) { |
| 166 | clients[0]->GotGfxBlock(type, id); // notify the new owner |
| 167 | } |
| 168 | return success; |
| 169 | } |
| 170 | |
| 171 | |
| 172 | //============================================================================// |
no test coverage detected