Shut down shared context properly to avoid segfault on close

This commit is contained in:
Mark Watkins 2011-06-12 17:25:50 +10:00
parent 38543bdd9a
commit 9747c9cce0
3 changed files with 14 additions and 9 deletions

View File

@ -8307,7 +8307,7 @@
<sleeplib/machine.h> <sleeplib/machine.h>
<list> <list>
1307862895 /home/mark/projects/git/sleepyhead/src/version.h 1307863514 /home/mark/projects/git/sleepyhead/src/version.h
1307627540 /home/mark/projects/git/sleepyhead/src/libs/sleeplib/prs1_loader.h 1307627540 /home/mark/projects/git/sleepyhead/src/libs/sleeplib/prs1_loader.h
"machine.h" "machine.h"

View File

@ -59,6 +59,9 @@ FTFont *texfont=NULL;
list<wxString> font_paths; list<wxString> font_paths;
wxGLContext *shared_context=NULL;
// Must be called from a thread inside the application. // Must be called from a thread inside the application.
void GraphInit() void GraphInit()
{ {
@ -111,6 +114,10 @@ void GraphDone()
delete normalfont; delete normalfont;
gfont_init=false; gfont_init=false;
} }
if (shared_context) {
delete shared_context;
shared_context=NULL;
}
} }
void GetTextExtent(wxString text, float & width, float & height, FTFont *font=normalfont) void GetTextExtent(wxString text, float & width, float & height, FTFont *font=normalfont)
@ -286,7 +293,6 @@ gGraphWindow::gGraphWindow()
{ {
} }
wxGLContext *shared_context=NULL;
gGraphWindow::gGraphWindow(wxWindow *parent, wxWindowID id,const wxString & title,const wxPoint &pos,const wxSize &size,long flags) gGraphWindow::gGraphWindow(wxWindow *parent, wxWindowID id,const wxString & title,const wxPoint &pos,const wxSize &size,long flags)
: wxGLCanvas( parent, shared_context, id, pos, size, flags, title, (int *)wx_gl_attribs, wxNullPalette ) : wxGLCanvas( parent, shared_context, id, pos, size, flags, title, (int *)wx_gl_attribs, wxNullPalette )
@ -328,7 +334,6 @@ gGraphWindow::~gGraphWindow()
for (list<gLayer *>::iterator l=layers.begin();l!=layers.end();l++) delete (*l); for (list<gLayer *>::iterator l=layers.begin();l!=layers.end();l++) delete (*l);
layers.clear(); layers.clear();
delete gl_context;
} }

View File

@ -16,14 +16,14 @@ namespace AutoVersion{
//Standard Version Type //Standard Version Type
static const long MAJOR = 0; static const long MAJOR = 0;
static const long MINOR = 7; static const long MINOR = 7;
static const long BUILD = 5137; static const long BUILD = 5140;
static const long REVISION = 11377; static const long REVISION = 11387;
//Miscellaneous Version Types //Miscellaneous Version Types
static const long BUILDS_COUNT = 4712; static const long BUILDS_COUNT = 4722;
#define RC_FILEVERSION 0,7,5137,11377 #define RC_FILEVERSION 0,7,5140,11387
#define RC_FILEVERSION_STRING "0, 7, 5137, 11377\0" #define RC_FILEVERSION_STRING "0, 7, 5140, 11387\0"
static const char FULLVERSION_STRING[] = "0.7.5137.11377"; static const char FULLVERSION_STRING[] = "0.7.5140.11387";
//These values are to keep track of your versioning state, don't modify them. //These values are to keep track of your versioning state, don't modify them.
static const long BUILD_HISTORY = 0; static const long BUILD_HISTORY = 0;