From dbfc4abfd6431548e5ecd581ad314fd7e00ca0b0 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Tue, 2 Jan 2018 12:38:35 +0100 Subject: [PATCH] thread/SafeSingleton: disallow copying --- src/thread/SafeSingleton.hxx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/thread/SafeSingleton.hxx b/src/thread/SafeSingleton.hxx index 386c1f376..ac7ff13a9 100644 --- a/src/thread/SafeSingleton.hxx +++ b/src/thread/SafeSingleton.hxx @@ -58,6 +58,9 @@ public: delete std::exchange(instance, nullptr); } + SafeSingleton(const SafeSingleton &) = delete; + SafeSingleton &operator=(const SafeSingleton &) = delete; + T *get() { return instance; }