Unref() marks an object as detached from the event loop. This is its * default state. When an object with a "weak" reference changes from * attached to detached state it will be freed. Be careful not to access * the object after making this call as it might be gone! * (A "weak reference" means an object that only has a * persistent handle.) * * DO NOT CALL THIS FROM DESTRUCT
| 105 | * DO NOT CALL THIS FROM DESTRUCTOR |
| 106 | */ |
| 107 | virtual void Unref() { |
| 108 | assert(!persistent().IsEmpty()); |
| 109 | assert(!persistent().IsWeak()); |
| 110 | assert(refs_ > 0); |
| 111 | if (--refs_ == 0) |
| 112 | MakeWeak(); |
| 113 | } |
| 114 | |
| 115 | int refs_; // ro |
| 116 |