Browse Source
Merge pull request #8569 from hez2010/visual-fixes
Avoid crashing when fail to create OpenGL context
pull/8692/head
Max Katz
4 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
7 additions and
0 deletions
-
src/Avalonia.OpenGL/Controls/OpenGlControlBase.cs
|
|
|
@ -146,6 +146,13 @@ namespace Avalonia.OpenGL.Controls |
|
|
|
return false; |
|
|
|
} |
|
|
|
|
|
|
|
if (_context == null) |
|
|
|
{ |
|
|
|
Logger.TryGet(LogEventLevel.Error, "OpenGL")?.Log("OpenGlControlBase", |
|
|
|
"Unable to initialize OpenGL: unable to create additional OpenGL context."); |
|
|
|
return false; |
|
|
|
} |
|
|
|
|
|
|
|
GlVersion = _context.Version; |
|
|
|
try |
|
|
|
{ |
|
|
|
|