Bug 675073 - Release OpenGL textures with the global context if the creating context has been destroyed. r=joe

This commit is contained in:
Matt Woodrow 2011-08-05 13:13:25 +12:00
parent bf397acbd6
commit fac88d4499

View File

@ -111,6 +111,15 @@ GLTexture::Release()
return;
}
if (mContext->IsDestroyed() && !mContext->IsGlobalSharedContext()) {
mContext = mContext->GetSharedContext();
if (!mContext) {
NS_ASSERTION(!mTexture,
"Context has been destroyed and couldn't find a shared context!");
return;
}
}
if (mTexture) {
if (NS_IsMainThread() || mContext->IsGlobalSharedContext()) {
mContext->MakeCurrent();