Sync a change from AMTL.

This commit is contained in:
David Anderson 2014-09-03 21:31:06 -07:00
parent a7cdf17d90
commit e608057304

View File

@ -55,6 +55,13 @@ class AlreadyRefed
: thing_(t) : 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() { ~AlreadyRefed() {
if (thing_) if (thing_)
thing_->Release(); thing_->Release();