diff --git a/gfx/layers/opengl/TextureHostOGL.cpp b/gfx/layers/opengl/TextureHostOGL.cpp index 6ec11cd40b80..10ee44c7a3e6 100644 --- a/gfx/layers/opengl/TextureHostOGL.cpp +++ b/gfx/layers/opengl/TextureHostOGL.cpp @@ -204,11 +204,10 @@ void TextureImageTextureSourceOGL::SetTextureSourceProvider(TextureSourceProvider* aProvider) { GLContext* newGL = aProvider ? aProvider->GetGLContext() : nullptr; - if (!mGL) { - mGL = newGL; - } else if (mGL != newGL) { + if (!newGL || mGL != newGL) { DeallocateDeviceData(); } + mGL = newGL; } gfx::IntSize