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


From: Sandro Santilli
Subject: [Gnash-commit] gnash ChangeLog server/movie_root.cpp
Date: Wed, 09 Jan 2008 00:58:14 +0000

CVSROOT:        /sources/gnash
Module name:    gnash
Changes by:     Sandro Santilli <strk>  08/01/09 00:58:14

Modified files:
        .              : ChangeLog 
        server         : movie_root.cpp 

Log message:
        properly destroy existing levels when loading into them.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.5348&r2=1.5349
http://cvs.savannah.gnu.org/viewcvs/gnash/server/movie_root.cpp?cvsroot=gnash&r1=1.140&r2=1.141

Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.5348
retrieving revision 1.5349
diff -u -b -r1.5348 -r1.5349
--- ChangeLog   9 Jan 2008 00:41:13 -0000       1.5348
+++ ChangeLog   9 Jan 2008 00:58:12 -0000       1.5349
@@ -1,5 +1,7 @@
 2008-01-08 Sandro Santilli <address@hidden>
 
+       * server/movie_root.cpp (setLevel): properly destroy
+         existing levels when loading into them.
        * testsuite/gnashrc.in: pretend we're version 
          Pretend we're version WIN 9,0,100,0 while running tests
          (to be predictable and compatible with swfdec testsuite)

Index: server/movie_root.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/movie_root.cpp,v
retrieving revision 1.140
retrieving revision 1.141
diff -u -b -r1.140 -r1.141
--- server/movie_root.cpp       25 Dec 2007 07:47:09 -0000      1.140
+++ server/movie_root.cpp       9 Jan 2008 00:58:13 -0000       1.141
@@ -170,12 +170,19 @@
        assert(movie != NULL);
        assert(static_cast<unsigned int>(movie->get_depth()) == 
num+character::staticDepthOffset);
 
-       //movie->setLevel(num)
-       //movie->set_depth(num);
-       //movie->set_name(ss.str().c_str());
 
-       //if ( _movies.size() < num+1 ) _movies.resize(num+1);
-       _movies[movie->get_depth()] = movie; // [num] = movie;
+       Levels::iterator it = _movies.find(movie->get_depth());
+       if ( it == _movies.end() )
+       {
+               _movies[movie->get_depth()] = movie; 
+       }
+       else
+       {
+               // don't leak overloaded levels
+               it->second->destroy();
+               it->second = movie;
+       }
+
 
        movie->set_invalidated();
        




reply via email to

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