1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 17:27:35 +00:00

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.
This commit is contained in:
Ben Wiederhake 2021-10-31 23:38:04 +01:00 committed by Andreas Kling
parent 4e55d649d7
commit 25032a02aa
3 changed files with 6 additions and 4 deletions

View file

@ -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;