gnash-commit
[Top][All Lists]
Advanced

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

[Gnash-commit] gnash server/parser/movie_def_impl.cpp server/p...


From: Sandro Santilli
Subject: [Gnash-commit] gnash server/parser/movie_def_impl.cpp server/p...
Date: Sat, 16 Jun 2007 06:55:58 +0000

CVSROOT:        /sources/gnash
Module name:    gnash
Changes by:     Sandro Santilli <strk>  07/06/16 06:55:58

Modified files:
        server/parser  : movie_def_impl.cpp movie_def_impl.h 
        testsuite      : MovieTester.cpp 

Log message:
        With this commit, sample/clip_as_button2.swf runs w/out memory faults 
in the GC model.
        
                * server/parser/movie_def_impl.{cpp,h} (markReachableResources):
                  Set CharacterDictionary items as reachable !
                  (BTW, why are character defs managed pointers ?!)
                * testsuite/MovieTester.cpp: initialize gnash code lib so
                  to work with GC on.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/server/parser/movie_def_impl.cpp?cvsroot=gnash&r1=1.72&r2=1.73
http://cvs.savannah.gnu.org/viewcvs/gnash/server/parser/movie_def_impl.h?cvsroot=gnash&r1=1.44&r2=1.45
http://cvs.savannah.gnu.org/viewcvs/gnash/testsuite/MovieTester.cpp?cvsroot=gnash&r1=1.43&r2=1.44

Patches:
Index: server/parser/movie_def_impl.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/parser/movie_def_impl.cpp,v
retrieving revision 1.72
retrieving revision 1.73
diff -u -b -r1.72 -r1.73
--- server/parser/movie_def_impl.cpp    15 Jun 2007 15:00:31 -0000      1.72
+++ server/parser/movie_def_impl.cpp    16 Jun 2007 06:55:56 -0000      1.73
@@ -1141,6 +1141,9 @@
        {
                (*i)->setReachable();
        }
+
+       _dictionary.markReachableResources();
+
 }
 #endif // GNASH_USE_GC
 

Index: server/parser/movie_def_impl.h
===================================================================
RCS file: /sources/gnash/gnash/server/parser/movie_def_impl.h,v
retrieving revision 1.44
retrieving revision 1.45
diff -u -b -r1.44 -r1.45
--- server/parser/movie_def_impl.h      15 Jun 2007 15:00:31 -0000      1.44
+++ server/parser/movie_def_impl.h      16 Jun 2007 06:55:57 -0000      1.45
@@ -166,6 +166,18 @@
 
        /// Dump content of the dictionary (debugging only)
        void dump_chars(void) const;
+
+#ifdef GNASH_USE_GC
+       /// Mark all dictionary items to be reachable (for GC)
+       void markReachableResources() const
+       {
+               for(const_iterator i=_map.begin(), e=_map.end(); i!=e; ++i)
+               {
+                       i->second->setReachable();
+               }
+       }
+#endif // GNASH_USE_GC
+
 private:
 
        container _map;
@@ -639,6 +651,7 @@
        ///     - sound samples (m_sound_samples)
        ///     - exports (m_exports)
        ///     - imported movies (m_import_source_movies)
+       ///     - character dictionary (_dictionary)
        ///
        /// TODO: do we really need all this stuff to be a GcResource ??
        ///

Index: testsuite/MovieTester.cpp
===================================================================
RCS file: /sources/gnash/gnash/testsuite/MovieTester.cpp,v
retrieving revision 1.43
retrieving revision 1.44
diff -u -b -r1.43 -r1.44
--- testsuite/MovieTester.cpp   7 Jun 2007 14:50:34 -0000       1.43
+++ testsuite/MovieTester.cpp   16 Jun 2007 06:55:57 -0000      1.44
@@ -55,6 +55,10 @@
        :
        _forceRedraw(true)
 {
+
+       // Initialize gnash code lib
+       gnashInit();
+
        if ( url == "-" )
        {
                std::auto_ptr<tu_file> in (




reply via email to

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