浏览代码

AudioServer: Turn ASMixer into a CObject

It was wrongly inheriting from RefCounted<AudioServer> without using
reference counting. Let's just make it a CObject instead.
Andreas Kling 6 年之前
父节点
当前提交
d5352b87b7
共有 2 个文件被更改,包括 8 次插入2 次删除
  1. 5 1
      Servers/AudioServer/ASMixer.cpp
  2. 3 1
      Servers/AudioServer/ASMixer.h

+ 5 - 1
Servers/AudioServer/ASMixer.cpp

@@ -5,7 +5,7 @@
 #include <limits>
 
 ASMixer::ASMixer()
-    : m_device("/dev/audio")
+    : m_device("/dev/audio", this)
 {
     if (!m_device.open(CIODevice::WriteOnly)) {
         dbgprintf("Can't open audio device: %s\n", m_device.error_string());
@@ -20,6 +20,10 @@ ASMixer::ASMixer()
         this);
 }
 
+ASMixer::~ASMixer()
+{
+}
+
 NonnullRefPtr<ASBufferQueue> ASMixer::create_queue(ASClientConnection& client)
 {
     LOCKER(m_lock);

+ 3 - 1
Servers/AudioServer/ASMixer.h

@@ -48,9 +48,11 @@ private:
     WeakPtr<ASClientConnection> m_client;
 };
 
-class ASMixer : public RefCounted<ASMixer> {
+class ASMixer : public CObject {
+    C_OBJECT(ASMixer)
 public:
     ASMixer();
+    virtual ~ASMixer() override;
 
     NonnullRefPtr<ASBufferQueue> create_queue(ASClientConnection&);