search for: swfdec_script_unref

Displaying 20 results from an estimated 37 matches for "swfdec_script_unref".

2007 Sep 08
0
9 commits - libswfdec/swfdec_as_context.c libswfdec/swfdec_as_internal.h libswfdec/swfdec_as_interpret.c libswfdec/swfdec_movie.c libswfdec/swfdec_player.c libswfdec/swfdec_video_movie_as.c
...- SwfdecScript *script; - swfdec_bits_init_data (&bits, swfdec_initialize, sizeof (swfdec_initialize)); - script = swfdec_script_new_from_bits (&bits, "init", version); - g_assert (script); - swfdec_as_object_run (context->global, script); - swfdec_script_unref (script); - } + + swfdec_as_context_run_init_script (context, swfdec_initialize, + sizeof (swfdec_initialize), 8); + - swfdec_xml_node_init_native (player, version); - swfdec_xml_init_native (player, version); - if (context->state == SWFDEC_AS_CONTEXT_NEW) { co...
2007 Apr 04
0
Branch 'as' - 9 commits - libswfdec/swfdec_as_context.c libswfdec/swfdec_as_frame.c libswfdec/swfdec_as_frame.h libswfdec/swfdec_as_function.c libswfdec/swfdec_as_interpret.c libswfdec/swfdec_as_stack.c libswfdec/swfdec_as_stack.h
...ec/swfdec_as_frame.c b/libswfdec/swfdec_as_frame.c index ca2d201..4614f7c 100644 --- a/libswfdec/swfdec_as_frame.c +++ b/libswfdec/swfdec_as_frame.c @@ -36,6 +36,14 @@ swfdec_as_frame_dispose (GObject *object g_slice_free1 (sizeof (SwfdecAsValue) * frame->n_registers, frame->registers); swfdec_script_unref (frame->script); swfdec_as_stack_free (frame->stack); + if (frame->constant_pool) { + swfdec_constant_pool_free (frame->constant_pool); + frame->constant_pool = NULL; + } + if (frame->constant_pool_buffer) { + swfdec_buffer_unref (frame->constant_pool_buffer); +...
2007 Aug 09
0
Branch 'vivi' - 12 commits - libswfdec-gtk/swfdec_gtk_player.c libswfdec-gtk/swfdec_gtk_player.h libswfdec/Makefile.am libswfdec/swfdec_as_array.h libswfdec/swfdec_as_context.c libswfdec/swfdec_as_context.h libswfdec/swfdec_as_debugger.c
...g_return_if_fail (command != NULL); + vivi_application_input (app, command); script = vivi_ming_compile (command, &error); if (script == NULL) { + vivi_application_error (app, error); g_free (error); } swfdec_as_object_run (SWFDEC_AS_CONTEXT (app)->global, script); swfdec_script_unref (script); } +void +vivi_application_send_message (ViviApplication *app, + ViviMessageType type, const char *format, ...) +{ + va_list args; + char *msg; + + va_start (args, format); + msg = g_strdup_vprintf (format, args); + va_end (args); + g_signal_emit (app, signals[MESSAGE], 0, (gui...
2007 Aug 20
2
libswfdec/swfdec_player.c
libswfdec/swfdec_player.c | 1 - 1 file changed, 1 deletion(-) New commits: diff-tree fd36de2f156ce685d5095aaf323e0766ea017bd7 (from c3b035ca1583a420402b965506129bd73ff3f5fe) Author: Benjamin Otte <otte at gnome.org> Date: Mon Aug 20 16:02:09 2007 +0200 no need for that header diff --git a/libswfdec/swfdec_player.c b/libswfdec/swfdec_player.c index b303408..cd58cf5 100644 ---
2007 Apr 17
0
Branch 'as' - 2 commits -
...yer * player, SwfdecBits * bits, const char * name, - unsigned int version); - guint version); -void swfdec_script_ref (SwfdecScript * script); ++ guint version); +SwfdecScript * swfdec_script_ref (SwfdecScript * script); void swfdec_script_unref (SwfdecScript * script); JSBool swfdec_script_interpret (SwfdecScript * script,
2007 Jun 06
0
Branch 'as' - libswfdec/Makefile.am libswfdec/swfdec_root_movie.c libswfdec/swfdec_root_sprite.c libswfdec/swfdec_root_sprite.h libswfdec/swfdec_swf_decoder.c libswfdec/swfdec_swf_decoder.h libswfdec/swfdec_tag.c
...ion, j); - - switch (action->type) { - case SWFDEC_ROOT_ACTION_EXPORT: - { - SwfdecRootExportData *data = action->data; - g_free (data->name); - g_object_unref (data->character); - g_free (data); - } - break; - case SWFDEC_ROOT_ACTION_INIT_SCRIPT: - swfdec_script_unref (action->data); - break; - default: - g_assert_not_reached (); - break; - } - } - g_array_free (array, TRUE); - } - } - g_free (root->root_actions); - root->root_actions = NULL; - } - - G_OBJECT_CLASS (swfdec_root_sprite_parent_class)->dispose (ob...
2007 Apr 17
0
15 commits - libswfdec/jpeg libswfdec/swfdec_bits.c libswfdec/swfdec_edittext.c libswfdec/swfdec_font.c libswfdec/swfdec_image.c libswfdec/swfdec_root_sprite.c libswfdec/swfdec_script.c libswfdec/swfdec_shape.c libswfdec/swfdec_sprite.c
...n, script)) { - /* assign a random buffer here so we have something to unref */ - script->buffer = bits->buffer; - swfdec_buffer_ref (script->buffer); + if (!swfdec_script_foreach_internal (bits, validate_action, script) || + (len -= swfdec_bits_left (bits) / 8) == 0) { swfdec_script_unref (script); return NULL; } - script->buffer = swfdec_buffer_new_subbuffer (bits->buffer, start - bits->buffer->data, - bits->ptr - start); + script->buffer = swfdec_bits_get_buffer (&org, len); return script; } @@ -2785,7 +2783,8 @@ swfdec_script_unref (Swfd...
2007 Apr 17
0
Branch 'as' - 17 commits - libswfdec/jpeg libswfdec/swfdec_bits.c libswfdec/swfdec_font.c libswfdec/swfdec_image.c libswfdec/swfdec_root_sprite.c libswfdec/swfdec_script.c libswfdec/swfdec_shape.c libswfdec/swfdec_sound.c libswfdec/swfdec_sprite.c
...n, script)) { - /* assign a random buffer here so we have something to unref */ - script->buffer = bits->buffer; - swfdec_buffer_ref (script->buffer); + if (!swfdec_script_foreach_internal (bits, validate_action, script) || + (len -= swfdec_bits_left (bits) / 8) == 0) { swfdec_script_unref (script); return NULL; } - script->buffer = swfdec_buffer_new_subbuffer (bits->buffer, start - bits->buffer->data, - bits->ptr - start); + script->buffer = swfdec_bits_get_buffer (&org, len); return script; } @@ -2785,7 +2783,8 @@ swfdec_script_unref (Swfd...
2007 Oct 11
0
12 commits - configure.ac doc/Makefile.am libswfdec/swfdec_as_frame.c libswfdec/swfdec_audio.c libswfdec/swfdec_audio_event.c libswfdec/swfdec_audio_event.h libswfdec/swfdec_shape_parser.c libswfdec/swfdec_sound.c test/sound
...a/libswfdec/swfdec_as_frame.c +++ b/libswfdec/swfdec_as_frame.c @@ -269,10 +269,6 @@ swfdec_as_frame_dispose (GObject *object SwfdecAsFrame *frame = SWFDEC_AS_FRAME (object); g_slice_free1 (sizeof (SwfdecAsValue) * frame->n_registers, frame->registers); - if (frame->script) { - swfdec_script_unref (frame->script); - frame->script = NULL; - } if (frame->constant_pool) { swfdec_constant_pool_free (frame->constant_pool); frame->constant_pool = NULL; @@ -285,6 +281,10 @@ swfdec_as_frame_dispose (GObject *object swfdec_as_frame_pop_block (frame); g_array_fr...
2007 Mar 09
0
libswfdec/swfdec_root_sprite.c libswfdec/swfdec_root_sprite.h
...ion, j); + + switch (action->type) { + case SWFDEC_ROOT_ACTION_EXPORT: + { + SwfdecRootExportData *data = action->data; + g_free (data->name); + g_object_unref (data->character); + g_free (data); + } + break; + case SWFDEC_ROOT_ACTION_INIT_SCRIPT: + swfdec_script_unref (action->data); + break; + default: + g_assert_not_reached (); + break; + } + } + g_array_free (array, TRUE); + } + } + g_free (root->root_actions); + root->root_actions = NULL; + } + + G_OBJECT_CLASS (swfdec_root_sprite_parent_class)->dispose (ob...
2007 Jan 26
0
Branch 'interpreter' - 9 commits - libswfdec/js libswfdec/Makefile.am libswfdec/swfdec_debugger.c libswfdec/swfdec_debugger.h libswfdec/swfdec_edittext_movie.c libswfdec/swfdec_event.c libswfdec/swfdec_js.c libswfdec/swfdec_js_global.c
...n_commands = array->len; + ret->commands = (SwfdecDebuggerCommand *) g_array_free (array, FALSE); return ret; } @@ -49,7 +65,13 @@ swfdec_debugger_script_new (JSScript *sc static void swfdec_debugger_script_free (SwfdecDebuggerScript *script) { + guint i; + g_assert (script); + swfdec_script_unref (script->script); + for (i = 0; i < script->n_commands; i++) { + g_free (script->commands[i].description); + } g_free (script->commands); g_free (script); } @@ -131,17 +153,16 @@ swfdec_debugger_new (void) } void -swfdec_debugger_add_script (SwfdecDebugger *debugger,...
2007 Aug 13
0
Branch 'vivi' - 24 commits - configure.ac libswfdec/swfdec_sprite_movie.c libswfdec/swfdec_tag.c libswfdec/swfdec_tag.h vivified/core vivified/dock vivified/ui
...ault: + g_assert_not_reached (); + break; + } +} + void vivi_applciation_execute (ViviApplication *app, const char *command) { @@ -203,6 +260,7 @@ vivi_applciation_execute (ViviApplicatio object = SWFDEC_AS_VALUE_GET_OBJECT (&val); swfdec_as_object_run (object, script); swfdec_script_unref (script); + vivi_application_check (app); } void @@ -222,25 +280,13 @@ vivi_application_send_message (ViviAppli g_free (msg); } -typedef enum { - VIVI_APPLICATION_STOPPED, - VIVI_APPLICATION_PLAYING, - VIVI_APPLICATION_STEPPING, -} ViviApplicationPlayback; - -static void -vivi_applica...
2007 May 18
0
Branch 'as' - libswfdec/Makefile.am libswfdec/swfdec_as_context.c libswfdec/swfdec_as_function.c libswfdec/swfdec_as_function.h libswfdec/swfdec_as_interpret.c libswfdec/swfdec_as_native_function.c libswfdec/swfdec_as_native_function.h
...fdec_as_stack.h" #include "swfdec_debug.h" -G_DEFINE_TYPE (SwfdecAsFunction, swfdec_as_function, SWFDEC_TYPE_AS_OBJECT) - -static void -swfdec_as_function_dispose (GObject *object) -{ - SwfdecAsFunction *function = SWFDEC_AS_FUNCTION (object); - - if (function->script) { - swfdec_script_unref (function->script); - function->script = NULL; - } - g_free (function->name); - function->name = NULL; - - G_OBJECT_CLASS (swfdec_as_function_parent_class)->dispose (object); -} - -static void -swfdec_as_function_mark (SwfdecAsObject *object) -{ - SwfdecAsFunction *function =...
2007 Mar 29
0
Branch 'as' - 9 commits - libswfdec-gtk/swfdec_playback_alsa.c libswfdec/js libswfdec/Makefile.am libswfdec/swfdec_as_context.c libswfdec/swfdec_as_context.h libswfdec/swfdec_as_frame.c libswfdec/swfdec_as_frame.h libswfdec/swfdec_as_function.c
...decPlayer * player, SwfdecBits * bits, const char * name, - unsigned int version); - guint version); -void swfdec_script_ref (SwfdecScript * script); ++ guint version); +SwfdecScript * swfdec_script_ref (SwfdecScript * script); void swfdec_script_unref (SwfdecScript * script); +#if 0 JSBool swfdec_script_interpret (SwfdecScript * script, JSContext * cx, jsval * rval); diff-tree 97a34e2bdc46d12e66fa103489e8f630fbf0d495 (from 22cdc6cbbf1030d34c2b4f414006cfcbf3a27c18) Author: Benjamin Otte <otte@gnome.org> Date:...
2007 Mar 29
0
Branch 'as' - 9 commits - configure.ac doc/swfdec-sections.txt libswfdec/Makefile.am libswfdec/swfdec_as_context.c libswfdec/swfdec_as_context.h libswfdec/swfdec_as_frame.c libswfdec/swfdec_as_frame.h libswfdec/swfdec_as_stack.c
...include "swfdec_as_stack.h" #include "swfdec_debug.h" G_DEFINE_TYPE (SwfdecAsFrame, swfdec_as_frame, SWFDEC_TYPE_AS_OBJECT) @@ -34,6 +35,7 @@ swfdec_as_frame_dispose (GObject *object g_slice_free1 (sizeof (SwfdecAsValue) * frame->n_registers, frame->registers); swfdec_script_unref (frame->script); + swfdec_as_stack_free (frame->stack); G_OBJECT_CLASS (swfdec_as_frame_parent_class)->dispose (object); } @@ -50,6 +52,7 @@ swfdec_as_frame_mark (SwfdecAsObject *ob for (i = 0; i < frame->n_registers; i++) { swfdec_as_value_mark (&frame->registe...
2007 Jun 18
0
Branch 'as' - 8 commits - libswfdec/swfdec_movie.c libswfdec/swfdec_sprite.c libswfdec/swfdec_sprite.h libswfdec/swfdec_sprite_movie.c libswfdec/swfdec_sprite_movie.h libswfdec/swfdec_swf_decoder.c libswfdec/swfdec_swf_decoder.h
...rite->frames[i].actions) { - guint j; - for (j = 0; j < sprite->frames[i].actions->len; j++) { - SwfdecSpriteAction *action = - &g_array_index (sprite->frames[i].actions, SwfdecSpriteAction, j); - switch (action->type) { - case SWFDEC_SPRITE_ACTION_SCRIPT: - swfdec_script_unref (action->data); - break; - case SWFDEC_SPRITE_ACTION_ADD: - case SWFDEC_SPRITE_ACTION_UPDATE: - swfdec_content_free (action->data); - break; - case SWFDEC_SPRITE_ACTION_REMOVE: - break; - default: - g_assert_not_reached (); - } - } - g_array_fre...
2007 Oct 23
0
6 commits - libswfdec/swfdec_as_frame.c libswfdec/swfdec_as_internal.h libswfdec/swfdec_as_interpret.c libswfdec/swfdec_as_interpret.h libswfdec/swfdec_as_object.c libswfdec/swfdec_as_script_function.c libswfdec/swfdec_flash_security.c
...hanks Valgrind diff --git a/libswfdec/swfdec_as_script_function.c b/libswfdec/swfdec_as_script_function.c index dc10056..c696305 100644 --- a/libswfdec/swfdec_as_script_function.c +++ b/libswfdec/swfdec_as_script_function.c @@ -56,6 +56,8 @@ swfdec_as_script_function_dispose (GObject *object) swfdec_script_unref (script->script); script->script = NULL; } + g_slist_free (script->scope_chain); + script->scope_chain = NULL; G_OBJECT_CLASS (swfdec_as_script_function_parent_class)->dispose (object); }
2007 Apr 03
0
11 commits - libswfdec-gtk/swfdec_gtk_loader.c libswfdec-gtk/swfdec_playback_alsa.c libswfdec-gtk/swfdec_source.c libswfdec/swfdec_cached.c libswfdec/swfdec_font.c libswfdec/swfdec_morphshape.c libswfdec/swfdec_net_stream.c libswfdec/swfdec_script.c
...efore freeing stack slots, because our caller may GC soon. */ fp->sp = fp->spbase; fp->spbase = NULL; + if (fp->constant_pool) { + swfdec_constant_pool_free (fp->constant_pool); + fp->constant_pool = NULL; + } js_FreeRawStack(cx, mark); cx->interpLevel--; swfdec_script_unref (script); @@ -3123,8 +3127,6 @@ swfdec_script_execute (SwfdecScript *scr ok = swfdec_script_interpret (script, cx, &frame.rval); js_FreeRawStack (cx, mark); - if (frame.constant_pool) - swfdec_constant_pool_free (frame.constant_pool); cx->fp = oldfp; if (oldfp) { diff-tre...
2007 Feb 01
0
Branch 'interpreter' - 9 commits - libswfdec/js libswfdec/swfdec_script.c libswfdec/swfdec_script.h player/swfdec_debug_stack.c test/trace
...1662,7 @@ swfdec_action_print_push (guint action, return g_string_free (string, FALSE); } +/* NB: constant pool actions are special in that they are called at init time */ static char * swfdec_action_print_constant_pool (guint action, const guint8 *data, guint len) { @@ -2010,6 +2035,8 @@ swfdec_script_unref (SwfdecScript *scrip return; swfdec_buffer_unref (script->buffer); + if (script->constant_pool) + swfdec_buffer_unref (script->constant_pool); g_free (script->name); g_free (script); } @@ -2068,6 +2095,16 @@ swfdec_script_interpret (SwfdecScript *s ok = JS_FALS...
2007 Feb 19
0
22 commits - libswfdec/js libswfdec/swfdec_debugger.c libswfdec/swfdec_js.c libswfdec/swfdec_js_global.c libswfdec/swfdec_js_movie.c libswfdec/swfdec_movie.c libswfdec/swfdec_player.c libswfdec/swfdec_player_internal.h libswfdec/swfdec_script.c
...;ll unset it again. diff --git a/libswfdec/js/jsfun.c b/libswfdec/js/jsfun.c index a085673..a6ae7fc 100644 --- a/libswfdec/js/jsfun.c +++ b/libswfdec/js/jsfun.c @@ -1042,6 +1042,9 @@ fun_convert(JSContext *cx, JSObject *obj } } +struct _SwfdecScript { + JSFunction * fun; +}; extern void swfdec_script_unref (void *script); static void fun_finalize(JSContext *cx, JSObject *obj) @@ -1059,8 +1062,10 @@ fun_finalize(JSContext *cx, JSObject *ob return; if (fun->script) js_DestroyScript(cx, fun->script); - if (fun->swf) + if (fun->swf) { swfdec_script_unref (fun-...