From 6eef68124fe76638e3418ab0333a9b14561b554f Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Tue, 30 Oct 2012 14:12:57 +0100 Subject: [PATCH] use custom Client::operator=(Client&&) to drop safe counts first --- src/client_manager.hh | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/client_manager.hh b/src/client_manager.hh index a9dac1a0..99500d4f 100644 --- a/src/client_manager.hh +++ b/src/client_manager.hh @@ -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{};