core/tempq: Add tempq_deinit() function
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
This commit is contained in:
parent
b3d95a06d4
commit
b919843717
|
@ -26,6 +26,7 @@ void core :: init(struct core_init_data *init)
|
|||
|
||||
void core :: deinit()
|
||||
{
|
||||
tempq_deinit();
|
||||
history_deinit();
|
||||
collection_deinit();
|
||||
playlist_deinit();
|
||||
|
|
|
@ -82,6 +82,12 @@ void tempq_init(struct queue_ops *ops)
|
|||
file_close(&deck_file);
|
||||
}
|
||||
|
||||
void tempq_deinit()
|
||||
{
|
||||
while (queue_deck.size() > 0)
|
||||
queue_deck.erase(queue_deck.begin());
|
||||
}
|
||||
|
||||
struct queue *tempq_alloc(struct queue_ops *ops, unsigned int flags)
|
||||
{
|
||||
struct queue *queue;
|
||||
|
|
|
@ -52,6 +52,9 @@ namespace deck
|
|||
/* Called to initialize the temporary queue manager. */
|
||||
void tempq_init(struct queue_ops *);
|
||||
|
||||
/* Called to deinitialize the temporary queue manager. */
|
||||
void tempq_deinit();
|
||||
|
||||
|
||||
/* Called to allocate a new temporary queue. */
|
||||
struct queue *tempq_alloc(struct queue_ops *, unsigned int);
|
||||
|
|
|
@ -101,6 +101,7 @@ static void test_next()
|
|||
test_equal(tempq_get(0), NULL);
|
||||
test_equal(tempq_count(), 0);
|
||||
|
||||
tempq_deinit();
|
||||
history_deinit();
|
||||
collection_deinit();
|
||||
playlist_deinit();
|
||||
|
|
Loading…
Reference in New Issue