From 371dc0877dd9333c727389e0e5feda8a0125934d Mon Sep 17 00:00:00 2001 From: Bergmann89 Date: Sun, 16 Nov 2014 20:39:03 +0100 Subject: [PATCH] * [Context] check Visual before using it --- uglcContextGtk2GLX.pas | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/uglcContextGtk2GLX.pas b/uglcContextGtk2GLX.pas index b3ddb20..f9d1475 100644 --- a/uglcContextGtk2GLX.pas +++ b/uglcContextGtk2GLX.pas @@ -351,6 +351,9 @@ var attrList: TGLIntArray; drawable: PGdkDrawable; begin + if not Assigned(aControl) then + raise EArgumentException.Create('aControl is not assigned'); + { Temporary (realized) widget to get to display } @@ -382,6 +385,8 @@ begin FVisual := glXChooseVisual(FDisplay, DefaultScreen(FDisplay), @attrList[0]); end; end; + if not Assigned(FVisual) then + raise EGLXError.Create('choose visual failed'); { Most widgets inherit the drawable of their parent. In contrast to Windows, descending from -- 2.1.4