diff options
author | Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com> | 2011-10-25 13:58:49 (GMT) |
---|---|---|
committer | Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com> | 2011-10-25 14:02:41 (GMT) |
commit | 207fb45ce7bac66ab53a0770d2bfb50d8d1997d8 (patch) | |
tree | 6b5d28f80776977abc54b84f6ab542256176092c /src/opengl/gl2paintengineex | |
parent | 8051a73be276995adfc4508a0cb5ad6451e8ab45 (diff) | |
download | Qt-207fb45ce7bac66ab53a0770d2bfb50d8d1997d8.zip Qt-207fb45ce7bac66ab53a0770d2bfb50d8d1997d8.tar.gz Qt-207fb45ce7bac66ab53a0770d2bfb50d8d1997d8.tar.bz2 |
Fix possible crash in glyph cache when deleting and creating contexts
The freeResource(), used in the glyph cache as a notifier of when the
owner context of the cache disappears, is never called if the context
is in a group with other contexts that share its resources. This
implements a second notifier function instead which can be used to
invalidate the glyph cache when its context is destroyed.
Task-number: QTBUG-22324
Reviewed-by: Samuel
Diffstat (limited to 'src/opengl/gl2paintengineex')
-rw-r--r-- | src/opengl/gl2paintengineex/qtextureglyphcache_gl_p.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/opengl/gl2paintengineex/qtextureglyphcache_gl_p.h b/src/opengl/gl2paintengineex/qtextureglyphcache_gl_p.h index 83ca06d..1a8bb0b 100644 --- a/src/opengl/gl2paintengineex/qtextureglyphcache_gl_p.h +++ b/src/opengl/gl2paintengineex/qtextureglyphcache_gl_p.h @@ -144,6 +144,10 @@ public: void clear(); + void contextDeleted(const QGLContext *context) { + if (ctx == context) + ctx = 0; + } void freeResource(void *) { ctx = 0; } private: |