From ea7acb53d67057ce642c6d57df8c3d11118c7e74 Mon Sep 17 00:00:00 2001
From: Benjamin Auder <benjamin.a@mailoo.org>
Date: Fri, 15 May 2015 09:18:40 +0200
Subject: [PATCH] fix problems in Queue.c / Stack.c ; still issues: to
 investigate

---
 src/Queue.c | 3 ++-
 src/Stack.c | 3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/Queue.c b/src/Queue.c
index 47e7dd5..794fa89 100644
--- a/src/Queue.c
+++ b/src/Queue.c
@@ -13,6 +13,7 @@ void _queue_init(Queue* queue, size_t dataSize)
 Queue* _queue_new(size_t dataSize)
 {
 	Queue* queue = (Queue*) safe_malloc(sizeof (Queue));
+	queue->array = _vector_new(dataSize);
 	_queue_init(queue, dataSize);
 	return queue;
 }
@@ -63,6 +64,6 @@ void queue_clear(Queue* queue)
 
 void queue_destroy(Queue* queue)
 {
-	queue_clear(queue);
+	vector_destroy(queue->array);
 	safe_free(queue);
 }
diff --git a/src/Stack.c b/src/Stack.c
index 545e83d..8aa7800 100644
--- a/src/Stack.c
+++ b/src/Stack.c
@@ -13,6 +13,7 @@ void _stack_init(Stack* stack, size_t dataSize)
 Stack* _stack_new(size_t dataSize)
 {
 	Stack* stack = (Stack*) safe_malloc(sizeof (Stack));
+	stack->array = _vector_new(dataSize);
 	_stack_init(stack, dataSize);
 	return stack;
 }
@@ -58,6 +59,6 @@ void stack_clear(Stack* stack)
 
 void stack_destroy(Stack* stack)
 {
-	stack_clear(stack);
+	vector_destroy(stack->array);
 	safe_free(stack);
 }
-- 
2.44.0