Name: Anonymous 2011-07-18 21:19
I keep getting heap corruption with the following code:
http://pastebin.com/gGdgPiYa
it occurs @ line 132 : free(queue_poll(q));
i checked it with a debugger and my polled element was still there and not Null or anything so why isn't it allowing to be freed? Also i use the queue code with another application that doesn't free the polled element and i end up memory leaks but if i try to free the element when i'm finish using it it heap corruptions me.
Header looks like:
http://pastebin.com/AwFKQcGe
queue_init(...) is no longer used i just haven't bothered to take it out btw so pay no attention to it.
http://pastebin.com/gGdgPiYa
it occurs @ line 132 : free(queue_poll(q));
i checked it with a debugger and my polled element was still there and not Null or anything so why isn't it allowing to be freed? Also i use the queue code with another application that doesn't free the polled element and i end up memory leaks but if i try to free the element when i'm finish using it it heap corruptions me.
Header looks like:
http://pastebin.com/AwFKQcGe
queue_init(...) is no longer used i just haven't bothered to take it out btw so pay no attention to it.