changeset 19488:8dbd55742112 stable

Prevent segfault when video card has insufficient OpenGL support (bug #41747). * __init_fltk__.cc: Check canvas->can_do () before trying to display plot.
author Andreas Weber <andy.weber.aw@gmail.com>
date Thu, 01 Jan 2015 18:47:36 -0800
parents 93dd3457eef9
children 17f5db3a9149 446c46af4b42
files libinterp/dldfcn/__init_fltk__.cc
diffstat 1 files changed, 3 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/libinterp/dldfcn/__init_fltk__.cc	Mon Dec 29 11:13:40 2014 +0100
+++ b/libinterp/dldfcn/__init_fltk__.cc	Thu Jan 01 18:47:36 2015 -0800
@@ -929,7 +929,9 @@
 
   void show_canvas (void)
   {
-    if (fp.is_visible ())
+    if (! canvas->can_do ())
+      error ("unable to plot due to insufficient OpenGL support");
+    else if (fp.is_visible ())
       {
         canvas->show ();
         canvas->make_current ();