use custom Client::operator=(Client&&) to drop safe counts first

This commit is contained in:
Maxime Coste 2012-10-30 14:12:57 +01:00
parent 1ea4b3998a
commit 6eef68124f

View File

@ -19,7 +19,16 @@ struct Client
context(new Context(*input_handler, window, *ui)) {}
Client(Client&&) = default;
Client& operator=(Client&&) = default;
Client& operator=(Client&& other)
{
// drop safe pointers first
context.reset();
ui = std::move(other.ui);
input_handler = std::move(other.input_handler);
context = std::move(other.context);
return *this;
}
};
struct client_removed{};