Chromium Code Reviews| Index: mojo/public/cpp/system/core.h |
| diff --git a/mojo/public/cpp/system/core.h b/mojo/public/cpp/system/core.h |
| index 2b1caa914a4b69770a9e632dbad6e01564bb5229..b7d0456bdc04ca7f23958351f54199003b7aac59 100644 |
| --- a/mojo/public/cpp/system/core.h |
| +++ b/mojo/public/cpp/system/core.h |
| @@ -107,6 +107,8 @@ class ScopedHandleBase { |
| // Move-only constructor and operator=. |
| ScopedHandleBase(RValue other) : handle_(other.object->release()) {} |
| ScopedHandleBase& operator=(RValue other) { |
| + if (handle_.is_valid() && handle_.value() != other.object->get().value()) |
|
viettrungluu
2014/06/17 22:58:25
Since a handle should only be in a single ScopedHa
Elliot Glaysher
2014/06/17 23:08:28
Switched to if (other.object != this). Didn't add
|
| + CloseIfNecessary(); |
| handle_ = other.object->release(); |
| return *this; |
| } |