From 87ff76bd57046ef9fb287c68b740fee6c601621a Mon Sep 17 00:00:00 2001 From: Gunnar Beutner Date: Wed, 2 Jun 2021 12:00:09 +0200 Subject: [PATCH] Kernel: Make KString non-copyable and non-movable The user is supposed to hold these in an OwnPtr but bad things would happen if the user takes these out of the OwnPtr so let's make the class non-copyable and non-movable. --- Kernel/KString.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Kernel/KString.h b/Kernel/KString.h index fcb88eeb81..7dc545e480 100644 --- a/Kernel/KString.h +++ b/Kernel/KString.h @@ -12,6 +12,9 @@ namespace Kernel { class KString { + AK_MAKE_NONCOPYABLE(KString); + AK_MAKE_NONMOVABLE(KString); + public: static OwnPtr try_create_uninitialized(size_t, char*&); static NonnullOwnPtr must_create_uninitialized(size_t, char*&);