2008-06-13 Emmanuele Bassi <ebassi@openedhand.com>

* clutter/clutter-texture.c:
	(clutter_texture_unrealize), (clutter_texture_dispose): Add a
	guard against reading back memory during the unrealization on
	dispose.
This commit is contained in:
Emmanuele Bassi 2008-06-13 14:58:18 +00:00
parent e3de3f196b
commit 76b71f8cc4
2 changed files with 19 additions and 1 deletions

View File

@ -1,3 +1,10 @@
2008-06-13 Emmanuele Bassi <ebassi@openedhand.com>
* clutter/clutter-texture.c:
(clutter_texture_unrealize), (clutter_texture_dispose): Add a
guard against reading back memory during the unrealization on
dispose.
2008-06-13 Emmanuele Bassi <ebassi@openedhand.com>
Bug #953 - Actors are not hidden before unrealized or

View File

@ -93,6 +93,8 @@ struct _ClutterTexturePrivate
guint local_data_rowstride;
guint local_data_has_alpha;
guchar *local_data;
guint in_dispose : 1;
};
enum
@ -213,7 +215,8 @@ clutter_texture_unrealize (ClutterActor *actor)
* a dispose run, and the dispose() call will release the GL
* texture data as well, so we can safely bail out now
*/
if (CLUTTER_PRIVATE_FLAGS (actor) & CLUTTER_ACTOR_IN_DESTRUCTION)
if ((CLUTTER_PRIVATE_FLAGS (actor) & CLUTTER_ACTOR_IN_DESTRUCTION) ||
priv->in_dispose)
return;
CLUTTER_MARK();
@ -466,6 +469,14 @@ clutter_texture_dispose (GObject *object)
priv = texture->priv;
/* mark that we are in dispose, so when the parent class'
* dispose implementation will call unrealize on us we'll
* not try to copy back the resources from video memory
* to system memory
*/
if (!priv->in_dispose)
priv->in_dispose = TRUE;
texture_free_gl_resources (texture);
texture_fbo_free_resources (texture);