[Top][All Lists]
[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: |
Fri, 02 May 2008 20:01:36 +0000 |
CVSROOT: /sources/gnash
Module name: gnash
Changes by: Sandro Santilli <strk> 08/05/02 20:01:36
Modified files:
. : ChangeLog
server : movie_root.cpp
Log message:
(cleanupUnloadedListeners): scan again if any unloaded character was
found.
Fixes an assertion failure with GNASH_PARANOIA_LEVEL > 1 while running
MovieClip.as tests.
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.6478&r2=1.6479
http://cvs.savannah.gnu.org/viewcvs/gnash/server/movie_root.cpp?cvsroot=gnash&r1=1.191&r2=1.192
Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.6478
retrieving revision 1.6479
diff -u -b -r1.6478 -r1.6479
--- ChangeLog 2 May 2008 17:11:54 -0000 1.6478
+++ ChangeLog 2 May 2008 20:01:35 -0000 1.6479
@@ -1,5 +1,11 @@
2008-05-02 Sandro Santilli <address@hidden>
+ * server/movie_root.cpp (cleanupUnloadedListeners): scan again if
+ any unloaded character was found. Fixes an assertion failure
+ with GNASH_PARANOIA_LEVEL > 1 while running MovieClip.as tests.
+
+2008-05-02 Sandro Santilli <address@hidden>
+
* server/DynamicShape.{cpp,h}, server/sprite_instance.{cpp,h},
server/styles.{cpp,h}: Add support for all known parameters
in the lineStyle call for swf8 up.
Index: server/movie_root.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/movie_root.cpp,v
retrieving revision 1.191
retrieving revision 1.192
diff -u -b -r1.191 -r1.192
--- server/movie_root.cpp 30 Apr 2008 14:29:38 -0000 1.191
+++ server/movie_root.cpp 2 May 2008 20:01:36 -0000 1.192
@@ -50,6 +50,24 @@
//#define GNASH_DEBUG_LOADMOVIE_REQUESTS_PROCESSING 1
//#define GNASH_DEBUG_TIMERS_EXPIRATION 1
+// Defining the macro below prints info about
+// cleanup of live chars (advanceable + key/mouse listeners)
+// Is useful in particular to check for cost of multiple scans
+// when a movie destruction destrois more elements.
+//
+// NOTE: I think the whole confusion here was introduced
+// by zou making it "optional" to ::unload() childs
+// when being unloaded. Zou was trying to avoid
+// queuing an onUnload event, which I suggested we'd
+// do by having unload() take an additional argument
+// or similar. Failing to tag childs as unloaded
+// will result in tagging them later (in ::destroy)
+// which will require scanning the lists again
+// (key/mouse + advanceable).
+// See https://savannah.gnu.org/bugs/index.php?21804
+//
+//#define GNASH_DEBUG_DLIST_CLEANUP 1
+
namespace gnash
{
@@ -1132,14 +1150,50 @@
void movie_root::cleanupUnloadedListeners(CharacterList& ll)
{
+ bool needScan;
+
+#ifdef GNASH_DEBUG_DLIST_CLEANUP
+ int scansCount = 0;
+#endif
+
+ do
+ {
+
+#ifdef GNASH_DEBUG_DLIST_CLEANUP
+ scansCount++;
+ int cleaned =0;
+#endif
+
+ needScan=false;
+
// remove unloaded character listeners from movie_root
for (CharacterList::iterator iter = ll.begin(); iter != ll.end(); )
{
character* ch = iter->get();
- if ( ch->isUnloaded() ) iter = ll.erase(iter);
+ if ( ch->isUnloaded() )
+ {
+ if ( ! ch->isDestroyed() )
+ {
+ ch->destroy();
+ needScan=true; // ->destroy() might mark already-scanned chars
as unloaded
+ }
+ iter = ll.erase(iter);
+
+#ifdef GNASH_DEBUG_DLIST_CLEANUP
+ cleaned++;
+#endif
+
+ }
+
else ++iter;
}
+#ifdef GNASH_DEBUG_DLIST_CLEANUP
+ cout << " Scan " << scansCount << " cleaned " << cleaned << " instances"
<< endl;
+#endif
+
+ } while (needScan);
+
}
void movie_root::notify_key_listeners(key::code k, bool down)
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Gnash-commit] gnash ChangeLog server/movie_root.cpp,
Sandro Santilli <=