gnash-commit
[Top][All Lists]
Advanced

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

[Gnash-commit] gnash ChangeLog server/movie_root.cpp server/mo...


From: Sandro Santilli
Subject: [Gnash-commit] gnash ChangeLog server/movie_root.cpp server/mo...
Date: Thu, 13 Sep 2007 14:39:21 +0000

CVSROOT:        /sources/gnash
Module name:    gnash
Changes by:     Sandro Santilli <strk>  07/09/13 14:39:21

Modified files:
        .              : ChangeLog 
        server         : movie_root.cpp movie_root.h 

Log message:
                * server/movie_root.{cpp,h} (restart): properly cleanup
                  action queue and instances list, reset levels so that
                  only _level0 is kept. Still not 100% correct but fixes
                  bug #21068.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.4303&r2=1.4304
http://cvs.savannah.gnu.org/viewcvs/gnash/server/movie_root.cpp?cvsroot=gnash&r1=1.88&r2=1.89
http://cvs.savannah.gnu.org/viewcvs/gnash/server/movie_root.h?cvsroot=gnash&r1=1.74&r2=1.75

Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.4303
retrieving revision 1.4304
diff -u -b -r1.4303 -r1.4304
--- ChangeLog   13 Sep 2007 13:57:48 -0000      1.4303
+++ ChangeLog   13 Sep 2007 14:39:21 -0000      1.4304
@@ -1,5 +1,12 @@
 2007-09-13 Sandro Santilli <address@hidden>
 
+       * server/movie_root.{cpp,h} (restart): properly cleanup
+         action queue and instances list, reset levels so that
+         only _level0 is kept. Still not 100% correct but fixes
+         bug #21068.
+
+2007-09-13 Sandro Santilli <address@hidden>
+
        * server/dlist.{cpp,h}: drop the second list only used for
          chils advancement (_timelineChars) and associated accessors
          (visitAllByReversePlacement).

Index: server/movie_root.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/movie_root.cpp,v
retrieving revision 1.88
retrieving revision 1.89
diff -u -b -r1.88 -r1.89
--- server/movie_root.cpp       13 Sep 2007 13:57:49 -0000      1.88
+++ server/movie_root.cpp       13 Sep 2007 14:39:21 -0000      1.89
@@ -184,10 +184,39 @@
 void
 movie_root::restart()
 {
-       for (Levels::iterator i=_movies.begin(), e=_movies.end(); i!=e; ++i)
-       {
-               i->second->restart();
-       }
+       // wipe out live chars
+       _liveChars.clear();
+
+       // wipe out queued actions
+       _actionQueue.clear();
+
+       // take a copy of _level0 
+       boost::intrusive_ptr<movie_instance> level0 = getLevel(0);
+
+       // wipe out all levels
+       _movies.clear();
+
+       // Restart the level0 movie
+       // TODO: instead, take it's definition and re-instantiate
+       // a new movie here ! The only problem would be re-setting
+       // externally set variables
+       level0->restart(); // NOTE: restart() will call construct
+
+       // Add level0 back in place
+       // NOTE: we don't call setLevel to avoid calling ::construct again
+       _movies[0] = level0; 
+
+       // Process actions queued by restart/construct
+       processActionQueue();
+
+       // Delete characters removed from the stage
+       // from the display lists
+       cleanupDisplayList();
+
+#ifdef GNASH_USE_GC
+       // Run the garbage collector again
+       GC::get().collect();
+#endif
 }
 
 void

Index: server/movie_root.h
===================================================================
RCS file: /sources/gnash/gnash/server/movie_root.h,v
retrieving revision 1.74
retrieving revision 1.75
diff -u -b -r1.74 -r1.75
--- server/movie_root.h 13 Sep 2007 13:57:49 -0000      1.74
+++ server/movie_root.h 13 Sep 2007 14:39:21 -0000      1.75
@@ -15,7 +15,7 @@
 // along with this program; if not, write to the Free Software
 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 
-/* $Id: movie_root.h,v 1.74 2007/09/13 13:57:49 strk Exp $ */
+/* $Id: movie_root.h,v 1.75 2007/09/13 14:39:21 strk Exp $ */
 
 /// \page events_handling Handling of user events
 ///
@@ -437,7 +437,13 @@
         return m_background_color.m_a / 255.0f;
     }
 
-    /// Restart all levels
+    /// Restart this application as if it was just loaded
+    //
+    /// NOTE: this doesn't work correctly in that rather then
+    ///       re-instantiating the original root movie it only
+    ///              picks *current* _level0, restarts it and place it
+    ///              back on stage.
+    ///
     void restart();
 
     /// Entry point for movie advancement




reply via email to

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