aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRobin Nehls <nehls@mi.fu-berlin.de>2010-01-05 19:10:26 +0100
committerAlexander Sulfrian <alexander@sulfrian.net>2013-01-05 17:17:43 +0100
commit7193f8eed605ee0eb9b437d228235605f67bfc0d (patch)
tree8a83943c108a558f7b5b2c5fe8922ad600c1b661
parent7ec3a35354e8f06f8cddc4adaf1be32266f94a80 (diff)
downloadusdx-7193f8eed605ee0eb9b437d228235605f67bfc0d.tar.gz
usdx-7193f8eed605ee0eb9b437d228235605f67bfc0d.tar.xz
usdx-7193f8eed605ee0eb9b437d228235605f67bfc0d.zip
Added initialisation to prevend segfaults
-rw-r--r--src/base/ringbuffer.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/base/ringbuffer.cpp b/src/base/ringbuffer.cpp
index d324f74f..e1761e82 100644
--- a/src/base/ringbuffer.cpp
+++ b/src/base/ringbuffer.cpp
@@ -31,10 +31,12 @@
namespace usdx
{
- RingBuffer::RingBuffer(int size)
+ RingBuffer::RingBuffer(int size):
+ buffer_count(0),
+ buffer_size(size),
+ write_pos(0),
+ read_pos(0)
{
- buffer_size = size;
-
ring_buffer = (char*)malloc(size);
if (ring_buffer == NULL)
throw "No memory";