Sync AMTL

This commit is contained in:
Arkshine
2014-09-18 19:29:58 +02:00
parent 87774ae21f
commit d4b0444d7a
4 changed files with 121 additions and 3 deletions

View File

@@ -55,6 +55,13 @@ class AlreadyRefed
: thing_(t)
{
}
AlreadyRefed(const AlreadyRefed<T> &other)
: thing_(other.thing_)
{
// If copy elision for some reason doesn't happen (for example, when
// returning from AdoptRef), just null out the source ref.
other.thing_ = NULL;
}
~AlreadyRefed() {
if (thing_)
thing_->Release();