From 525f27cdaa0c2407c8662fa686a5a49005471dae Mon Sep 17 00:00:00 2001 From: Benjamin Otte Date: Fri, 9 Nov 2007 15:10:11 +0100 Subject: [PATCH] implement unloading of movies --- libswfdec/swfdec_as_interpret.c | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/libswfdec/swfdec_as_interpret.c b/libswfdec/swfdec_as_interpret.c index a1c456ce..81fb2fc2 100644 --- a/libswfdec/swfdec_as_interpret.c +++ b/libswfdec/swfdec_as_interpret.c @@ -1143,8 +1143,17 @@ swfdec_action_get_url (SwfdecAsContext *cx, guint action, const guint8 *data, gu } else if (swfdec_player_request_fscommand (SWFDEC_PLAYER (cx), url, target)) { /* nothing to do here */ } else if (swfdec_player_get_level (SWFDEC_PLAYER (cx), target) >= 0) { - swfdec_resource_load (SWFDEC_PLAYER (cx), target, url, - SWFDEC_LOADER_REQUEST_DEFAULT, NULL, NULL); + if (url[0] == '\0') { + SwfdecMovie *movie = swfdec_player_get_movie_from_string (SWFDEC_PLAYER (cx), target); + if (SWFDEC_IS_SPRITE_MOVIE (movie)) { + char *path = swfdec_movie_get_path (movie, TRUE); + swfdec_player_request_unload (SWFDEC_PLAYER (cx), path); + g_free (path); + } + } else { + swfdec_resource_load (SWFDEC_PLAYER (cx), target, url, + SWFDEC_LOADER_REQUEST_DEFAULT, NULL, NULL); + } } g_free (url); g_free (target); @@ -1187,7 +1196,16 @@ swfdec_action_get_url2 (SwfdecAsContext *cx, guint action, const guint8 *data, g swfdec_movie_load_variables (movie, url, method, NULL); } } else if (internal) { - swfdec_resource_load (SWFDEC_PLAYER (cx), target, url, method, NULL, NULL); + if (url[0] == '\0') { + SwfdecMovie *movie = swfdec_player_get_movie_from_string (SWFDEC_PLAYER (cx), target); + if (SWFDEC_IS_SPRITE_MOVIE (movie)) { + char *path = swfdec_movie_get_path (movie, TRUE); + swfdec_player_request_unload (SWFDEC_PLAYER (cx), path); + g_free (path); + } + } else { + swfdec_resource_load (SWFDEC_PLAYER (cx), target, url, method, NULL, NULL); + } } else { /* load an external file */ swfdec_player_launch (SWFDEC_PLAYER (cx), method, url, target, NULL); -- 2.11.4.GIT