diff options
author | Ben Wiederhake <BenWiederhake.GitHub@gmx.de> | 2021-10-31 23:38:04 +0100 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-11-02 22:56:53 +0100 |
commit | b3e9a4e603ce6371e7c1a092bd70e5f367384c4b (patch) | |
tree | 680062ea1e2fddcd179edde5eee4bf7f6685eed2 /Userland/Libraries/LibChess | |
parent | 3796d417e00599c263c69ebf1ef4c0dcc52261a7 (diff) | |
download | serenity-b3e9a4e603ce6371e7c1a092bd70e5f367384c4b.zip |
Libraries: Fix visibility of Object-derivative constructors
Derivatives of Core::Object should be constructed through
ClassName::construct(), to avoid handling ref-counted objects with
refcount zero. Fixing the visibility means that misuses like this are
more difficult.
Diffstat (limited to 'Userland/Libraries/LibChess')
-rw-r--r-- | Userland/Libraries/LibChess/UCIEndpoint.h | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/Userland/Libraries/LibChess/UCIEndpoint.h b/Userland/Libraries/LibChess/UCIEndpoint.h index 8207525028..430d8edcfc 100644 --- a/Userland/Libraries/LibChess/UCIEndpoint.h +++ b/Userland/Libraries/LibChess/UCIEndpoint.h @@ -18,9 +18,6 @@ class Endpoint : public Core::Object { public: virtual ~Endpoint() override { } - Endpoint() { } - Endpoint(NonnullRefPtr<Core::IODevice> in, NonnullRefPtr<Core::IODevice> out); - virtual void handle_uci() { } virtual void handle_debug(const DebugCommand&) { } virtual void handle_isready() { } @@ -48,6 +45,10 @@ public: } void set_out(RefPtr<Core::IODevice> out) { m_out = out; } +protected: + Endpoint() { } + Endpoint(NonnullRefPtr<Core::IODevice> in, NonnullRefPtr<Core::IODevice> out); + private: void set_in_notifier(); NonnullOwnPtr<Command> read_command(); |