I notice that you are returning false whether IsEmpty() returns true or false. Is that really what you want to do? Perhaps that is the source of the problem. Otherwise it must be something in the IsEmpty() function. You would need to post that code here to get feedback.
We can walk to school together. And we can both read this tiny ad:
the new thread boost feature brings a LOT of attention to your favorite threads