My application crashes on the emulator (S60 2.6) in a call to eglCopyBuffers:

eglCopyBuffers(iDisplay, iSurface, iBitmap);

where iBitmap is an CWsBitmap initialized like this:

iBitmap = new(ELeave) CWsBitmap(iEikonEnv->WsSession());
iBitmap->Create(Rect().Size(), iEikonEnv->ScreenDevice()->DisplayMode());

I also tried to change it to CFbsBitmap, without any difference. This code works fine on the actual device.

Debugging it with Carbide.c++ only gave the information that the actual crash happens in EUser called by libGLES_CM, and exception "Signal 5" was received, with the description "Access violation".

Since GL ES/egl stuff seems to work fine otherwise, I suspect the problem lies in the bitmap. Does anybody have a clue about what I'm doing wrong?

Thanks in advance,
// Martin