mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-20 07:17:32 +09:00
Issue #1354 - Clear the current context when MakeCurrent() fails.
This commit is contained in:
parent
8d600c51ed
commit
9d76eb5791
10 changed files with 81 additions and 95 deletions
|
|
@ -36,35 +36,24 @@ GLContextEAGL::GLContextEAGL(CreateContextFlags flags, const SurfaceCaps& caps,
|
|||
|
||||
GLContextEAGL::~GLContextEAGL()
|
||||
{
|
||||
MakeCurrent();
|
||||
|
||||
if (mBackbufferFB) {
|
||||
fDeleteFramebuffers(1, &mBackbufferFB);
|
||||
}
|
||||
|
||||
if (mBackbufferRB) {
|
||||
fDeleteRenderbuffers(1, &mBackbufferRB);
|
||||
if (MakeCurrent()) {
|
||||
if (mBackbufferFB) {
|
||||
fDeleteFramebuffers(1, &mBackbufferFB);
|
||||
}
|
||||
if (mBackbufferRB) {
|
||||
fDeleteRenderbuffers(1, &mBackbufferRB);
|
||||
}
|
||||
}
|
||||
|
||||
mLayer = nil;
|
||||
MarkDestroyed();
|
||||
|
||||
if (mLayer) {
|
||||
mLayer = nil;
|
||||
}
|
||||
|
||||
if (mContext) {
|
||||
[EAGLContext setCurrentContext:nil];
|
||||
[mContext release];
|
||||
}
|
||||
[mContext release];
|
||||
}
|
||||
|
||||
bool
|
||||
GLContextEAGL::Init()
|
||||
{
|
||||
if (!InitWithPrefix("gl", true))
|
||||
return false;
|
||||
|
||||
return true;
|
||||
return InitWithPrefix("gl", true);
|
||||
}
|
||||
|
||||
bool
|
||||
|
|
@ -120,12 +109,12 @@ GLContextEAGL::MakeCurrentImpl(bool aForce)
|
|||
return true;
|
||||
}
|
||||
|
||||
if (mContext) {
|
||||
if(![EAGLContext setCurrentContext:mContext]) {
|
||||
return false;
|
||||
}
|
||||
if (IsDestroyed()) {
|
||||
[EAGLContext setCurrentContext:nil];
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
|
||||
return [EAGLContext setCurrentContext:mContext];
|
||||
}
|
||||
|
||||
bool
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue