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
Родитель bf397acbd6
Коммит fac88d4499
1 изменённых файлов: 9 добавлений и 0 удалений

Просмотреть файл

@ -111,6 +111,15 @@ GLTexture::Release()
return; 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 (mTexture) {
if (NS_IsMainThread() || mContext->IsGlobalSharedContext()) { if (NS_IsMainThread() || mContext->IsGlobalSharedContext()) {
mContext->MakeCurrent(); mContext->MakeCurrent();