Firstly, you don't initialize x to 0.
Secondly in your loop you delete the first element and pop the last one so it doesn't get deleted. Just omit the pop. If you want the deque empty, use clear() after the loop.
By the way, note that you don't need the intermediate variable ptr.
1 2
mydeque.push_back( new object );//you may add nothrow if you like
delete mydeque.at(x);//or mydeque[x]
Awesome thanks alot. I wrote this in notepad at work so the x and pop_back errors are pretty dumb lol. But Yeah it would make sense to do away with the pointer altogether. I just wanted a dynamic array to hold some game objects instead of having a bunch of random object instances. So thanks again for clearing all this up.