gnash-commit
[Top][All Lists]
Advanced

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

[Gnash-commit] gnash ChangeLog server/button_character_instanc...


From: Sandro Santilli
Subject: [Gnash-commit] gnash ChangeLog server/button_character_instanc...
Date: Tue, 22 Apr 2008 09:12:45 +0000

CVSROOT:        /sources/gnash
Module name:    gnash
Changes by:     Sandro Santilli <strk>  08/04/22 09:12:45

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

Log message:
        override ::destroy in button_character_instance 
        (every character overriding ::unload should do this).

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.6340&r2=1.6341
http://cvs.savannah.gnu.org/viewcvs/gnash/server/button_character_instance.cpp?cvsroot=gnash&r1=1.99&r2=1.100
http://cvs.savannah.gnu.org/viewcvs/gnash/server/button_character_instance.h?cvsroot=gnash&r1=1.39&r2=1.40

Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.6340
retrieving revision 1.6341
diff -u -b -r1.6340 -r1.6341
--- ChangeLog   21 Apr 2008 18:30:19 -0000      1.6340
+++ ChangeLog   22 Apr 2008 09:12:44 -0000      1.6341
@@ -1,3 +1,9 @@
+2008-04-22 Sandro Santilli <address@hidden>
+
+       * server/button_character_instance.{cpp,h}: override
+         ::destroy (every character overriding ::unload should
+         do this).
+
 2008-04-21 Benjamin Wolsey <address@hidden>
 
        * server/asobj/LocalConnection.cpp: log unimplemented message only

Index: server/button_character_instance.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/button_character_instance.cpp,v
retrieving revision 1.99
retrieving revision 1.100
diff -u -b -r1.99 -r1.100
--- server/button_character_instance.cpp        21 Apr 2008 11:27:42 -0000      
1.99
+++ server/button_character_instance.cpp        22 Apr 2008 09:12:45 -0000      
1.100
@@ -946,6 +946,8 @@
 bool
 button_character_instance::unload()
 {
+       //log_debug("Button %s being unloaded", getTarget());
+
        bool childsHaveUnload = false;
 
        // We need to unload all childs, or the global instance list will keep 
growing forever !
@@ -959,6 +961,12 @@
                //log_debug("Button child %s (%s) unloaded", 
ch->getTarget().c_str(), typeName(*ch).c_str());
        }
 
+       // NOTE: we don't need to ::unload or ::destroy here
+       //       as the _hitCharacters are never placed on stage.
+       //       As an optimization we might not even instantiate
+       //       them, and only use the definition and the 
+       //       associated transform matrix... (would take
+       //       hit instance off the GC).
        _hitCharacters.clear();
 
        bool hasUnloadEvent = character::unload();
@@ -966,6 +974,31 @@
        return hasUnloadEvent || childsHaveUnload;
 }
 
+void
+button_character_instance::destroy()
+{
+       //log_debug("Button %s being destroyed", getTarget());
+
+       for (CharsVect::iterator i=m_record_character.begin(), 
e=m_record_character.end(); i!=e; ++i)
+       {
+               character* ch = *i;
+               if ( ! ch ) continue;
+               if ( ch->isDestroyed() ) continue;
+               ch->destroy();
+               *i = NULL;
+       }
+
+       // NOTE: we don't need to ::unload or ::destroy here
+       //       as the _hitCharacters are never placed on stage.
+       //       As an optimization we might not even instantiate
+       //       them, and only use the definition and the 
+       //       associated transform matrix... (would take
+       //       hit instance off the GC).
+       _hitCharacters.clear();
+
+       character::destroy();
+}
+
 bool
 button_character_instance::get_member(string_table::key name_key, as_value* 
val,
   string_table::key nsname)

Index: server/button_character_instance.h
===================================================================
RCS file: /sources/gnash/gnash/server/button_character_instance.h,v
retrieving revision 1.39
retrieving revision 1.40
diff -u -b -r1.39 -r1.40
--- server/button_character_instance.h  21 Apr 2008 11:27:42 -0000      1.39
+++ server/button_character_instance.h  22 Apr 2008 09:12:45 -0000      1.40
@@ -149,6 +149,9 @@
        /// Properly unload contained characters
        bool unload();
 
+       /// Properly destroy contained characters
+       void destroy();
+
 #ifdef USE_SWFTREE
        // Override to append button characters info, see dox in character.h
        virtual InfoTree::iterator getMovieInfo(InfoTree& tr, 
InfoTree::iterator it);




reply via email to

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