diff options
author | Kim Motoyoshi Kalland <kim.kalland@nokia.com> | 2009-08-28 15:28:38 (GMT) |
---|---|---|
committer | Kim Motoyoshi Kalland <kim.kalland@nokia.com> | 2009-08-31 12:27:04 (GMT) |
commit | 5cd15cc3e4da69074d6cd0a2c5b3a987af4e24c1 (patch) | |
tree | 23f58c7f75c753c305fc1225b86fff0b5a9e9140 /src/opengl/qgl_p.h | |
parent | e5f823c014238469fbec6de1983a6bf0c392cbbc (diff) | |
download | Qt-5cd15cc3e4da69074d6cd0a2c5b3a987af4e24c1.zip Qt-5cd15cc3e4da69074d6cd0a2c5b3a987af4e24c1.tar.gz Qt-5cd15cc3e4da69074d6cd0a2c5b3a987af4e24c1.tar.bz2 |
Fixed crash when sharing OpenGL contexts in the GL2 paint engine.
Shader objects had a pointer to the context they were originally
created in. If the context was destroyed, the shader would (on Windows)
dereference an invalid pointer and cause the program to crash. I
replaced the context pointer with a pointer to the context group. I
also added checks in debug mode to make sure the context associated
with the shader shares resources with the current context.
Reviewed-by: Tom
Diffstat (limited to 'src/opengl/qgl_p.h')
-rw-r--r-- | src/opengl/qgl_p.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/opengl/qgl_p.h b/src/opengl/qgl_p.h index 14502c7..2fd3070 100644 --- a/src/opengl/qgl_p.h +++ b/src/opengl/qgl_p.h @@ -275,13 +275,17 @@ public: GLuint current_fbo; QPaintEngine *active_engine; + static inline QGLContextGroupResources *qt_get_context_group(const QGLContext *ctx) { return ctx->d_ptr->groupResources; } + #ifdef Q_WS_WIN static inline QGLExtensionFuncs& qt_get_extension_funcs(const QGLContext *ctx) { return ctx->d_ptr->groupResources->extensionFuncs; } + static inline QGLExtensionFuncs& qt_get_extension_funcs(QGLContextGroupResources *ctx) { return ctx->extensionFuncs; } #endif #if defined(Q_WS_X11) || defined(Q_WS_MAC) || defined(Q_WS_QWS) static QGLExtensionFuncs qt_extensionFuncs; static inline QGLExtensionFuncs& qt_get_extension_funcs(const QGLContext *) { return qt_extensionFuncs; } + static inline QGLExtensionFuncs& qt_get_extension_funcs(QGLContextGroupResources *ctx) { return qt_extensionFuncs; } #endif QPixmapFilter *createPixmapFilter(int type) const; |