Benjamin Otte
2008-Jan-19 12:07 UTC
[Swfdec] 5 commits - libswfdec/swfdec_as_object.c libswfdec/swfdec_loader.c libswfdec/swfdec_style_sheet.c libswfdec/swfdec_text_field_movie_as.c libswfdec/swfdec_text_field_movie.c test/swfdec_test_test.c
libswfdec/swfdec_as_object.c | 3 +++ libswfdec/swfdec_loader.c | 8 +------- libswfdec/swfdec_style_sheet.c | 3 ++- libswfdec/swfdec_text_field_movie.c | 12 ++++++------ libswfdec/swfdec_text_field_movie_as.c | 4 ++++ test/swfdec_test_test.c | 1 + 6 files changed, 17 insertions(+), 14 deletions(-) New commits: commit 2ddba438108342502c59bc4f09d96118a59b5e33 Author: Benjamin Otte <otte at gnome.org> Date: Sat Jan 19 03:27:03 2008 +0100 we need to clear the stylesheet reference if the style sheet dies before us sems signals aren't the proper way to do this marshalling either diff --git a/libswfdec/swfdec_text_field_movie.c b/libswfdec/swfdec_text_field_movie.c index 040c336..bc8cdb6 100644 --- a/libswfdec/swfdec_text_field_movie.c +++ b/libswfdec/swfdec_text_field_movie.c @@ -1060,13 +1060,13 @@ swfdec_text_field_movie_dispose (GObject *object) text->asterisks_length = 0; } - if (text->style_sheet) { - if (SWFDEC_IS_STYLESHEET (text->style_sheet)) { - g_signal_handlers_disconnect_matched (text->style_sheet, - G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, text); - } - text->style_sheet = NULL; + if (SWFDEC_IS_STYLESHEET (text->style_sheet)) { + g_signal_handlers_disconnect_matched (text->style_sheet, + G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, text); + g_object_remove_weak_pointer (G_OBJECT (text->style_sheet), + (gpointer *) &text->style_sheet); } + text->style_sheet = NULL; for (iter = text->formats; iter != NULL; iter = iter->next) { g_free (text->formats->data); diff --git a/libswfdec/swfdec_text_field_movie_as.c b/libswfdec/swfdec_text_field_movie_as.c index 5d76ed4..1003011 100644 --- a/libswfdec/swfdec_text_field_movie_as.c +++ b/libswfdec/swfdec_text_field_movie_as.c @@ -932,6 +932,8 @@ swfdec_text_field_movie_set_styleSheet (SwfdecAsContext *cx, if (text->style_sheet != NULL && SWFDEC_IS_STYLESHEET (text->style_sheet)) { g_signal_handlers_disconnect_by_func (text->style_sheet, swfdec_text_field_movie_style_sheet_update, text); + g_object_remove_weak_pointer (G_OBJECT (text->style_sheet), + (gpointer *) &text->style_sheet); } text->style_sheet = value; @@ -939,6 +941,8 @@ swfdec_text_field_movie_set_styleSheet (SwfdecAsContext *cx, if (SWFDEC_IS_STYLESHEET (value)) { g_signal_connect_swapped (value, "update", G_CALLBACK (swfdec_text_field_movie_style_sheet_update), text); + g_object_add_weak_pointer (G_OBJECT (text->style_sheet), + (gpointer *) &text->style_sheet); swfdec_text_field_movie_style_sheet_update (text); } commit de423981f1b112c1f9141c8cc7c9e79ababe8b7a Author: Benjamin Otte <otte at gnome.org> Date: Sat Jan 19 03:10:34 2008 +0100 memleak + invalid pointer references after GC diff --git a/libswfdec/swfdec_as_object.c b/libswfdec/swfdec_as_object.c index a5af75d..854681d 100644 --- a/libswfdec/swfdec_as_object.c +++ b/libswfdec/swfdec_as_object.c @@ -130,6 +130,8 @@ swfdec_as_object_dispose (GObject *gobject) SwfdecAsObject *object = SWFDEC_AS_OBJECT (gobject); g_assert (object->properties == NULL); + g_slist_free (object->interfaces); + object->interfaces = NULL; G_OBJECT_CLASS (swfdec_as_object_parent_class)->dispose (gobject); } @@ -167,6 +169,7 @@ swfdec_as_object_do_mark (SwfdecAsObject *object) g_hash_table_foreach (object->properties, swfdec_as_object_mark_property, NULL); if (object->watches) g_hash_table_foreach (object->watches, swfdec_as_object_mark_watch, NULL); + g_slist_foreach (object->interfaces, (GFunc) swfdec_as_object_mark, NULL); } static void commit 23be23222d6120f80642f74f2ef421e5bb2887d7 Author: Benjamin Otte <otte at gnome.org> Date: Sat Jan 19 02:39:07 2008 +0100 memleak diff --git a/libswfdec/swfdec_style_sheet.c b/libswfdec/swfdec_style_sheet.c index f146c8a..847b199 100644 --- a/libswfdec/swfdec_style_sheet.c +++ b/libswfdec/swfdec_style_sheet.c @@ -202,7 +202,7 @@ swfdec_style_sheet_parse (SwfdecAsContext *cx, const char *css) p = swfdec_style_sheet_parse_selectors (cx, p, object, selectors); } else { if (*p == '}') { - selectors->len = 0; + g_ptr_array_set_size (selectors, 0); p++; p += strspn (p, " \t\r\n"); } else { @@ -219,6 +219,7 @@ swfdec_style_sheet_parse (SwfdecAsContext *cx, const char *css) } } + g_ptr_array_free (selectors, TRUE); if (p == NULL) return NULL; commit 49c482349ce3e2288ba4b5ba125a014125c5b325 Author: Benjamin Otte <otte at gnome.org> Date: Sat Jan 19 02:27:56 2008 +0100 memleak What was that supposed to do?! diff --git a/libswfdec/swfdec_loader.c b/libswfdec/swfdec_loader.c index f3e3642..e089eef 100644 --- a/libswfdec/swfdec_loader.c +++ b/libswfdec/swfdec_loader.c @@ -606,7 +606,7 @@ char * swfdec_loader_get_text (SwfdecLoader *loader, guint version) { SwfdecBuffer *buffer; - char *raw, *text; + char *text; guint size, i, j; /* get the text from the loader */ @@ -615,12 +615,6 @@ swfdec_loader_get_text (SwfdecLoader *loader, guint version) SWFDEC_LOG ("empty loader, returning empty string"); return g_strdup (""); } - raw = g_try_malloc (size + 1); - if (!raw) { - SWFDEC_ERROR ("not enough memory to copy %u bytes", size); - swfdec_buffer_queue_clear (loader->queue); - return NULL; - } buffer = swfdec_buffer_queue_peek (loader->queue, size); if (!buffer) commit 02f8e37a36d647a227223cec8ff1cc997040c845 Author: Benjamin Otte <otte at gnome.org> Date: Sat Jan 19 02:20:48 2008 +0100 memleak diff --git a/test/swfdec_test_test.c b/test/swfdec_test_test.c index f1a5d9f..46fa6a6 100644 --- a/test/swfdec_test_test.c +++ b/test/swfdec_test_test.c @@ -249,6 +249,7 @@ swfdec_test_do_reset (SwfdecTestTest *test, const char *filename) if (filename == NULL) return; + g_free (test->filename); test->filename = g_strdup (filename); test->player_quit = FALSE; }
Possibly Parallel Threads
- 9 commits - libswfdec/swfdec_as_strings.c libswfdec/swfdec_html_parser.c libswfdec/swfdec_style_sheet.c libswfdec/swfdec_style_sheet.h libswfdec/swfdec_text_field_movie_as.c libswfdec/swfdec_text_field_movie.c libswfdec/swfdec_text_field_movie.h
- 11 commits - libswfdec/swfdec_as_internal.h libswfdec/swfdec_as_object.c libswfdec/swfdec_html_parser.c libswfdec/swfdec_initialize.as libswfdec/swfdec_initialize.h libswfdec/swfdec_style_sheet.c libswfdec/swfdec_style_sheet.h
- 5 commits - libswfdec/swfdec_as_array.c libswfdec/swfdec_as_array.h libswfdec/swfdec_as_date.c libswfdec/swfdec_as_date.h libswfdec/swfdec_as_initialize.as libswfdec/swfdec_as_interpret.c libswfdec/swfdec_as_object.c libswfdec/swfdec_filter.c
- 11 commits - libswfdec/swfdec_as_strings.c libswfdec/swfdec_text_field.c libswfdec/swfdec_text_field.h libswfdec/swfdec_text_field_movie_as.c libswfdec/swfdec_text_field_movie.c libswfdec/swfdec_text_field_movie.h test/trace
- 6 commits - libswfdec/swfdec_as_strings.c libswfdec/swfdec_codec_audio.c libswfdec/swfdec_codec_video.c libswfdec/swfdec_text_field.c libswfdec/swfdec_text_field.h libswfdec/swfdec_text_field_movie_as.c libswfdec/swfdec_text_field_movie.c