gnash-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Gnash-dev] garbage collector and the VM._global object


From: strk
Subject: Re: [Gnash-dev] garbage collector and the VM._global object
Date: Tue, 29 Jul 2008 21:30:25 +0200

On Wed, Jul 30, 2008 at 01:29:30AM +0800, Tom Stellard wrote:
> I have been trying to use the VM._global object to look up and retrieve
> properties while trying to execute some of the code in ABC blocks, and I
> keep getting this error message when i try and call functions that use the
> global object (as_object::dump_members()  for example):
> 
> lt-gprocessor: ../libbase/GC.h:232: void gnash::GC::addCollectable(const
> gnash::GcResource*): Assertion `self == mainThread' failed.
> 
> I was wondering if someone could give me some more information about what
> this message means, why it might be happening, and what I can do to avoid
> it.


The garbage collector maintain every GcResource object, which
includes as_object and all descendants.
GcResource instances register themselves at construction time
and gnash model only supports registration with GC happening
in main thread, that is the same thread that created the GC
instance.

If you get that assertion failure I guess you're trying to
execute ABC blocks at parse time, as the parser runs in
a separate thread.

What you should be doing is defining a class like DoActionTag
(see libcore/swf/DoActionTag.h), that is a ControlTag.
ControlTag instances are executed by main thread when
the playhead enters the frame containing it.

You'll just have to register the ControlTag with the
movie_definition containing it (addControlTag, see
DoActionTag::doActionLoader)) and provide an execute()
method.

--strk;




reply via email to

[Prev in Thread] Current Thread [Next in Thread]