gnash-commit
[Top][All Lists]
Advanced

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

[Gnash-commit] gnash ChangeLog server/PropertyList.cpp server/...


From: Sandro Santilli
Subject: [Gnash-commit] gnash ChangeLog server/PropertyList.cpp server/...
Date: Mon, 05 Feb 2007 09:39:50 +0000

CVSROOT:        /sources/gnash
Module name:    gnash
Changes by:     Sandro Santilli <strk>  07/02/05 09:39:50

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

Log message:
                * server/PropertyList.cpp: delete overridden properties in 
import();
                  properly clear current container on assignment operator (also 
fixed
                  it's signature).
                * server/PropertyList.h: Properly document Property ownership.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.2248&r2=1.2249
http://cvs.savannah.gnu.org/viewcvs/gnash/server/PropertyList.cpp?cvsroot=gnash&r1=1.7&r2=1.8
http://cvs.savannah.gnu.org/viewcvs/gnash/server/PropertyList.h?cvsroot=gnash&r1=1.10&r2=1.11

Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.2248
retrieving revision 1.2249
diff -u -b -r1.2248 -r1.2249
--- ChangeLog   5 Feb 2007 07:18:29 -0000       1.2248
+++ ChangeLog   5 Feb 2007 09:39:50 -0000       1.2249
@@ -1,3 +1,10 @@
+2007-02-05 Sandro Santilli <address@hidden>
+
+       * server/PropertyList.cpp: delete overridden properties in import();
+         properly clear current container on assignment operator (also fixed
+         it's signature).
+       * server/PropertyList.h: Properly document Property ownership.
+
 2007-02-05 Zou Lunkai <address@hidden>
 
        * server/movie_root.cpp, server/asobj/xml.cpp,

Index: server/PropertyList.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/PropertyList.cpp,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -b -r1.7 -r1.8
--- server/PropertyList.cpp     10 Dec 2006 18:39:22 -0000      1.7
+++ server/PropertyList.cpp     5 Feb 2007 09:39:50 -0000       1.8
@@ -46,9 +46,13 @@
 }
 
 PropertyList&
-PropertyList::operator==(const PropertyList& pl)
+PropertyList::operator=(const PropertyList& pl)
 {
-       if ( this != &pl ) import(pl);
+       if ( this != &pl )
+       {
+               clear();
+               import(pl);
+       }
        return *this;
 }
 
@@ -200,8 +204,18 @@
                const std::string& name = it->first;
                const Property* prop = it->second;
 
+               // Delete any previous property with this name
+               iterator found = _props.find( name );
+               if ( found != _props.end() )
+               {
+                       delete found->second;
+                       found->second = prop->clone();
+               }
+               else
+               {
                _props[name] = prop->clone();
        }
+       }
 }
 
 bool

Index: server/PropertyList.h
===================================================================
RCS file: /sources/gnash/gnash/server/PropertyList.h,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -b -r1.10 -r1.11
--- server/PropertyList.h       23 Jan 2007 11:26:49 -0000      1.10
+++ server/PropertyList.h       5 Feb 2007 09:39:50 -0000       1.11
@@ -47,6 +47,10 @@
 
 /// Set of properties associated to an ActionScript object.
 //
+/// The PropertyList container is the sole owner of the Property
+/// elements in it contained and has full responsibility of their
+/// construction and destruction.
+///
 class PropertyList
 {
 
@@ -100,7 +104,7 @@
        PropertyList(const PropertyList& pl);
 
        /// Assignment operator
-       PropertyList& operator==(const PropertyList&);
+       PropertyList& operator=(const PropertyList&);
 
        /// Delete all Property objects in the container
        ~PropertyList();




reply via email to

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