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 | 25032a02aab7fda7713c8b1d6546ca48ec2677e5 (patch) | |
tree | 7581c5fc3d010a604179445065c8e8279adf2cf4 /Userland/Services/AudioServer/Mixer.h | |
parent | 4e55d649d72055f817439f5db8517c9af9cab44a (diff) | |
download | serenity-25032a02aab7fda7713c8b1d6546ca48ec2677e5.zip |
AudioServer: 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.
This commit is separate from the other Servives changes because it
required additional adaption of the code. Note that the old code did
precisely what these changes try to prevent: Create and handle a
ref-counted object with a refcount of zero.
Diffstat (limited to 'Userland/Services/AudioServer/Mixer.h')
-rw-r--r-- | Userland/Services/AudioServer/Mixer.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/Userland/Services/AudioServer/Mixer.h b/Userland/Services/AudioServer/Mixer.h index d56d97fef8..a9dbde4cc8 100644 --- a/Userland/Services/AudioServer/Mixer.h +++ b/Userland/Services/AudioServer/Mixer.h @@ -108,7 +108,6 @@ private: class Mixer : public Core::Object { C_OBJECT(Mixer) public: - Mixer(NonnullRefPtr<Core::ConfigFile> config); virtual ~Mixer() override; NonnullRefPtr<ClientAudioStream> create_queue(ClientConnection&); @@ -124,6 +123,8 @@ public: u16 audiodevice_get_sample_rate() const; private: + Mixer(NonnullRefPtr<Core::ConfigFile> config); + void request_setting_sync(); Vector<NonnullRefPtr<ClientAudioStream>> m_pending_mixing; |