Wombat Queue Destroy

Sam Wilson <Sam.Wilson@...>


I'm trying to use Wombat Queue, but I can't figure out how to safely
free a queue when the creation fails. Here's my example:

wombatQueue queue;
wombatQueueStatus status = wombatQueue_allocate(&queue);
if (WOMBAT_QUEUE_OK != status) {
return; // log the error state or what have you

status = wombatQueue_create(queue, MAX_SIZE, INITIAL_SIZE,
if (WOMBAT_QUEUE_OK != status) {
wombatQueue_destroy(queue); // Doesn't work because the
// queue hasn't been created.

// So how do I free the memory allocated by
// wombatQueue_allocate?

Thanks for your help,

Join Openmama-dev@lists.openmama.org to automatically receive all group messages.