Bug 929506 - fix context bug in BasicTextureImage. r=bjacob

This commit is contained in:
Nicolas Silva 2013-12-03 11:44:49 +01:00
parent 9b7045644c
commit 0b72fc8329

View File

@ -73,9 +73,8 @@ BasicTextureImage::~BasicTextureImage()
// if we don't have a context (either real or shared),
// then they went away when the contex was deleted, because it
// was the only one that had access to it.
if (ctx && !ctx->IsDestroyed()) {
mGLContext->MakeCurrent();
mGLContext->fDeleteTextures(1, &mTexture);
if (ctx && ctx->MakeCurrent()) {
ctx->fDeleteTextures(1, &mTexture);
}
}
@ -699,7 +698,9 @@ CreateBasicTextureImage(GLContext* aGL,
TextureImage::ImageFormat aImageFormat)
{
bool useNearestFilter = aFlags & TextureImage::UseNearestFilter;
aGL->MakeCurrent();
if (!aGL->MakeCurrent()) {
return nullptr;
}
GLuint texture = 0;
aGL->fGenTextures(1, &texture);