]> git.tdb.fi Git - libs/gui.git/blobdiff - source/graphics/cgl/glcontext.cpp
Create GLContext::priv later to avoid memory leaks
[libs/gui.git] / source / graphics / cgl / glcontext.cpp
index 94b9b2f465652a36a215696ebfccfbf1fa6dbac0..7e06d2333aea4c631b0e956e0fbe6047d5380737 100644 (file)
@@ -19,8 +19,6 @@ struct GLContext::Private
 
 void GLContext::platform_init(const GLOptions &opts)
 {
-       priv = new Private;
-
        vector<unsigned> attribs;
        
        attribs.push_back(CPF_DEPTH_SIZE);
@@ -55,6 +53,7 @@ void GLContext::platform_init(const GLOptions &opts)
        if(!pixfmt)
                throw unsupported_gl_mode(opts);
 
+       priv = new Private;
        priv->context = create_gl_context(pixfmt);
        destroy_pixel_format(pixfmt);