Преглед изворни кода

Fixed potential memory leak in RingBuffer

Joseph Henry пре 6 година
родитељ
комит
23996c7e6b
1 измењених фајлова са 5 додато и 0 уклоњено
  1. 5 0
      node/RingBuffer.hpp

+ 5 - 0
node/RingBuffer.hpp

@@ -72,6 +72,11 @@ public:
 		memset(buf, 0, sizeof(T) * size);
 	}
 
+	~RingBuffer()
+	{
+		delete [] buf;
+	}
+
 	/**
 	 * @return A pointer to the underlying buffer
 	 */