Fixed memory leak inside queue.cpp.