diff options
author | Robert Bragg <robert@linux.intel.com> | 2010-10-26 17:38:58 +0100 |
---|---|---|
committer | Neil Roberts <neil@linux.intel.com> | 2010-11-11 13:28:57 +0000 |
commit | 5b2eb9186371a498bfa4a27cf561d5c1c5d71aa7 (patch) | |
tree | 643c7c40945368a5ab0558051b95ce6f2630772a | |
parent | 9ddfc6ab0169816a763aa61435f0611eb5fa4086 (diff) | |
download | clutter-5b2eb9186371a498bfa4a27cf561d5c1c5d71aa7.tar.gz |
cogl-object: correctly free user_data_array in _unref
If there is private data associated with a CoglObject then there may be
a user_data_array that needs to be freed. The code was mistakenly
freeing the array inside the loop that was actually iterating over the
user data array notifying the objects destruction instead of waiting
until all the data entries had been destroyed.
(cherry picked from commit e5202d6a0da1d94f65ddbe381766d775e1047e26)
-rw-r--r-- | clutter/cogl/cogl/cogl-object.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/clutter/cogl/cogl/cogl-object.c b/clutter/cogl/cogl/cogl-object.c index aa11cef2c..7a5472ce3 100644 --- a/clutter/cogl/cogl/cogl-object.c +++ b/clutter/cogl/cogl/cogl-object.c @@ -86,9 +86,8 @@ cogl_object_unref (void *object) if (entry->destroy) entry->destroy (entry->user_data); } + g_array_free (obj->user_data_array, TRUE); } - - g_array_free (obj->user_data_array, TRUE); } COGL_OBJECT_DEBUG_FREE (obj); |