This is what I think is happening:
- The original pbuffer was created successfully.
- At some point, .isBufferLost() returns true.
- You destroy the original pbuffer.
- You create another pbuffer, but an exception is thrown and the pbuffer variable continues to reference the original pbuffer.
- The next time .isBufferLost() is called on a destroyed pbuffer, so you get that exception.
Indeed, my previous reply wasn't accurate.