From aa24352e70bdc5cbeaa212055b25cb810ab6d71d Mon Sep 17 00:00:00 2001 From: Mark Watkins Date: Wed, 16 Jan 2013 15:37:09 +1000 Subject: [PATCH] shutdown framebufferobject properly if used --- Graphs/gGraphView.cpp | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/Graphs/gGraphView.cpp b/Graphs/gGraphView.cpp index ec4706e7..02183d46 100644 --- a/Graphs/gGraphView.cpp +++ b/Graphs/gGraphView.cpp @@ -45,6 +45,12 @@ QFont * defaultfont=NULL; QFont * mediumfont=NULL; QFont * bigfont=NULL; +//MW: ick globals, but I want a system wide framebuffer of decent proprotions.. +bool fbo_unsupported=false; +QGLFramebufferObject *fbo=NULL; +const int max_fbo_width=2048; +const int max_fbo_height=2048; + bool evil_intel_graphics_chip=false; extern QLabel * qstatus2; @@ -118,6 +124,12 @@ void DoneGraphs() for (QHash::iterator i=images.begin();i!=images.end();i++) { delete i.value(); } + if (fbo) { // Clear the frame buffer object + if (fbo->isBound()) fbo->release(); + delete fbo; + fbo=NULL; + fbo_unsupported=true; // just in case shutdown order gets messed up + } _graph_init=false; } } @@ -1857,12 +1869,6 @@ QPixmap gGraphView::pbRenderPixmap(int w,int h) } -//MW: ick globals, but I want a system wide framebuffer of decent proprotions.. -bool fbo_unsupported=false; -QGLFramebufferObject *fbo=NULL; -const int max_fbo_width=2048; -const int max_fbo_height=2048; - QPixmap gGraphView::fboRenderPixmap(int w,int h) { QPixmap pm=QPixmap();