[webkit-changes] cvs commit: WebCore/khtml/html html_miscimpl.cpp html_miscimpl.h

Maciej mjs at opensource.apple.com
Tue Aug 16 16:57:07 PDT 2005


mjs         05/08/16 16:57:07

  Modified:    .        ChangeLog
               khtml/html html_miscimpl.cpp html_miscimpl.h
  Log:
          Reviewed by John.
  
  	- fixed leak of HTML collection info - this can build up to
  	hundreds of leaks pretty quickly
  
  	http://bugzilla.opendarwin.org/show_bug.cgi?id=4450
  
          * khtml/html/html_miscimpl.cpp:
          (DOM::HTMLCollectionImpl::HTMLCollectionImpl): Initialize new
  	m_ownsInfo member.
          (DOM::HTMLCollectionImpl::~HTMLCollectionImpl): Delete info if
  	owned.
          (DOM::HTMLCollectionImpl::resetCollectionInfo): When creating new
  	info, indicate that it's owned.
          * khtml/html/html_miscimpl.h: Declare new member.
  
  Revision  Changes    Path
  1.4589    +18 -0     WebCore/ChangeLog
  
  Index: ChangeLog
  ===================================================================
  RCS file: /cvs/root/WebCore/ChangeLog,v
  retrieving revision 1.4588
  retrieving revision 1.4589
  diff -u -r1.4588 -r1.4589
  --- ChangeLog	16 Aug 2005 21:53:48 -0000	1.4588
  +++ ChangeLog	16 Aug 2005 23:57:02 -0000	1.4589
  @@ -1,3 +1,21 @@
  +2005-08-15  Maciej Stachowiak  <mjs at apple.com>
  +
  +        Reviewed by John.
  +
  +	- fixed leak of HTML collection info - this can build up to
  +	hundreds of leaks pretty quickly
  +
  +	http://bugzilla.opendarwin.org/show_bug.cgi?id=4450
  +	
  +        * khtml/html/html_miscimpl.cpp:
  +        (DOM::HTMLCollectionImpl::HTMLCollectionImpl): Initialize new
  +	m_ownsInfo member.
  +        (DOM::HTMLCollectionImpl::~HTMLCollectionImpl): Delete info if
  +	owned.
  +        (DOM::HTMLCollectionImpl::resetCollectionInfo): When creating new
  +	info, indicate that it's owned.
  +        * khtml/html/html_miscimpl.h: Declare new member.
  +
   2005-08-16  David Harrison  <harrison at apple.com>
   
           <rdar://problem/4119646> assertion failure in DOM::Position::upstream at babelfish.com
  
  
  
  1.33      +5 -1      WebCore/khtml/html/html_miscimpl.cpp
  
  Index: html_miscimpl.cpp
  ===================================================================
  RCS file: /cvs/root/WebCore/khtml/html/html_miscimpl.cpp,v
  retrieving revision 1.32
  retrieving revision 1.33
  diff -u -r1.32 -r1.33
  --- html_miscimpl.cpp	30 Jul 2005 02:33:17 -0000	1.32
  +++ html_miscimpl.cpp	16 Aug 2005 23:57:06 -0000	1.33
  @@ -76,7 +76,8 @@
       : m_base(_base),
         type(_type),
         info(0),
  -      idsDone(false)
  +      idsDone(false),
  +      m_ownsInfo(false)
   {
       if (_base->isDocumentNode() && _base->getDocument()->isHTMLDocument())
           info = static_cast<HTMLDocumentImpl*>(_base->getDocument())->collectionInfo(type);
  @@ -84,6 +85,8 @@
   
   HTMLCollectionImpl::~HTMLCollectionImpl()
   {
  +    if (m_ownsInfo)
  +        delete info;
   }
   
   HTMLCollectionImpl::CollectionInfo::CollectionInfo() :
  @@ -112,6 +115,7 @@
   
       if (!info) {
           info = new CollectionInfo;
  +        m_ownsInfo = true;
           info->version = docversion;
           return;
       }
  
  
  
  1.21      +2 -0      WebCore/khtml/html/html_miscimpl.h
  
  Index: html_miscimpl.h
  ===================================================================
  RCS file: /cvs/root/WebCore/khtml/html/html_miscimpl.h,v
  retrieving revision 1.20
  retrieving revision 1.21
  diff -u -r1.20 -r1.21
  --- html_miscimpl.h	21 Jul 2005 04:10:52 -0000	1.20
  +++ html_miscimpl.h	16 Aug 2005 23:57:07 -0000	1.21
  @@ -132,6 +132,8 @@
   
       // For nextNamedItem()
       mutable bool idsDone;
  +
  +    mutable bool m_ownsInfo;
   };
   
   class HTMLNameCollectionImpl : public HTMLCollectionImpl
  
  
  



More information about the webkit-changes mailing list