I picture it working like this:
* allocate the data structure
* put it into the queue
* pull structures off the queue
* pass structure around to each plugin
* when all plugins have processed the structure, release the memory
What is it about your code that's different from what I just described?