| 164 | mutable std::atomic<unsigned> _refCount = 1; |
| 165 | TestObject() { instanceCounter.fetch_add(1); } |
| 166 | void delref() const { |
| 167 | if (--_refCount == 0) { |
| 168 | delete this; |
| 169 | --instanceCounter; |
| 170 | } |
| 171 | } |
| 172 | void addref() const { ++_refCount; } |
| 173 | }; |
| 174 |