[SCM] WebKit Debian packaging branch, debian/unstable, updated. debian/1.1.15-1-40151-g37bb677

rjw rjw at 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sat Sep 26 07:43:57 UTC 2009


The following commit has been merged in the debian/unstable branch:
commit 0153712026a90522a2e90259cc0d2c98ad75838f
Author: rjw <rjw at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Tue Jun 3 19:47:46 2003 +0000

    	Fixed 3275565.  Ref count the decoder.
    
            Reviewed by Ken.
    
            * khtml/khtml_part.cpp:
            (KHTMLPart::clear):
            * khtml/misc/decoder.cpp:
            (Decoder::Decoder):
            (Decoder::~Decoder):
            * khtml/misc/decoder.h:
            * khtml/xml/dom_docimpl.cpp:
            (DocumentImpl::~DocumentImpl):
            * khtml/xml/dom_docimpl.h:
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@4472 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog-2003-10-25 b/WebCore/ChangeLog-2003-10-25
index 1bad949..1ecdb82 100644
--- a/WebCore/ChangeLog-2003-10-25
+++ b/WebCore/ChangeLog-2003-10-25
@@ -1,3 +1,20 @@
+2003-06-03  Richard Williamson   <rjw at apple.com>
+
+	Fixed 3275565.  Ref count the decoder.
+
+        Reviewed by Ken.
+
+        * khtml/khtml_part.cpp:
+        (KHTMLPart::clear):
+        * khtml/misc/decoder.cpp:
+        (Decoder::Decoder):
+        (Decoder::~Decoder):
+        * khtml/misc/decoder.h:
+        * khtml/xml/dom_docimpl.cpp:
+        (DocumentImpl::~DocumentImpl):
+        * khtml/xml/dom_docimpl.h:
+	
+
 2003-06-02  David Hyatt  <hyatt at apple.com>
 
 	Fix for 3276099.  value() was wrong for radio buttons.  Needed
diff --git a/WebCore/ChangeLog-2005-08-23 b/WebCore/ChangeLog-2005-08-23
index 1bad949..1ecdb82 100644
--- a/WebCore/ChangeLog-2005-08-23
+++ b/WebCore/ChangeLog-2005-08-23
@@ -1,3 +1,20 @@
+2003-06-03  Richard Williamson   <rjw at apple.com>
+
+	Fixed 3275565.  Ref count the decoder.
+
+        Reviewed by Ken.
+
+        * khtml/khtml_part.cpp:
+        (KHTMLPart::clear):
+        * khtml/misc/decoder.cpp:
+        (Decoder::Decoder):
+        (Decoder::~Decoder):
+        * khtml/misc/decoder.h:
+        * khtml/xml/dom_docimpl.cpp:
+        (DocumentImpl::~DocumentImpl):
+        * khtml/xml/dom_docimpl.h:
+	
+
 2003-06-02  David Hyatt  <hyatt at apple.com>
 
 	Fix for 3276099.  value() was wrong for radio buttons.  Needed
diff --git a/WebCore/khtml/khtml_part.cpp b/WebCore/khtml/khtml_part.cpp
index 2ed0df0..8e802a6 100644
--- a/WebCore/khtml/khtml_part.cpp
+++ b/WebCore/khtml/khtml_part.cpp
@@ -958,7 +958,8 @@ void KHTMLPart::clear()
     d->m_doc->deref();
   d->m_doc = 0;
 
-  delete d->m_decoder;
+  if (d->m_decoder)
+    d->m_decoder->deref();
   d->m_decoder = 0;
 
 #if !APPLE_CHANGES
diff --git a/WebCore/khtml/misc/decoder.cpp b/WebCore/khtml/misc/decoder.cpp
index 9c89817..c62af22 100644
--- a/WebCore/khtml/misc/decoder.cpp
+++ b/WebCore/khtml/misc/decoder.cpp
@@ -263,8 +263,9 @@ breakBreak:
     return (code);
 }
 
-Decoder::Decoder()
+Decoder::Decoder() 
 {
+    _refCount = 1;
     // latin1
     m_codec = QTextCodec::codecForName("iso8859-1");
     m_decoder = m_codec->makeDecoder();
@@ -276,6 +277,7 @@ Decoder::Decoder()
 }
 Decoder::~Decoder()
 {
+    assert(_refCount == 0);
     delete m_decoder;
 }
 
diff --git a/WebCore/khtml/misc/decoder.h b/WebCore/khtml/misc/decoder.h
index 4672544..1d2b978 100644
--- a/WebCore/khtml/misc/decoder.h
+++ b/WebCore/khtml/misc/decoder.h
@@ -56,6 +56,9 @@ public:
 
     QString flush() const;
 
+    void ref() { ++_refCount; }
+    void deref() { if (!--_refCount) delete this; }
+
 protected:
     // codec used for decoding. default is Latin1.
     QTextCodec *m_codec;
@@ -74,6 +77,8 @@ protected:
     bool body;
     bool beginning;
     bool visualRTL;
+
+    unsigned _refCount;
 };
 
 }
diff --git a/WebCore/khtml/xml/dom_docimpl.cpp b/WebCore/khtml/xml/dom_docimpl.cpp
index 9902dd2..5c83c4d 100644
--- a/WebCore/khtml/xml/dom_docimpl.cpp
+++ b/WebCore/khtml/xml/dom_docimpl.cpp
@@ -343,6 +343,11 @@ DocumentImpl::~DocumentImpl()
         delete m_renderArena;
         m_renderArena = 0;
     }
+    
+    if (m_decoder){
+        m_decoder->deref();
+        m_decoder = 0;
+    }
 }
 
 
diff --git a/WebCore/khtml/xml/dom_docimpl.h b/WebCore/khtml/xml/dom_docimpl.h
index 4a6b6b8..68ac7df 100644
--- a/WebCore/khtml/xml/dom_docimpl.h
+++ b/WebCore/khtml/xml/dom_docimpl.h
@@ -262,7 +262,7 @@ public:
     void setBaseTarget(const QString& baseTarget) { m_baseTarget = baseTarget; }
 
 #if APPLE_CHANGES
-    void setDecoder(khtml::Decoder *d) { m_decoder = d; }
+    void setDecoder(khtml::Decoder *d) { m_decoder = d; d->ref();}
     QString completeURL(const QString &);
 #else
     QString completeURL(const QString& url) { return KURL(baseURL(),url).url(); };
diff --git a/WebCore/kwq/KWQPageState.mm b/WebCore/kwq/KWQPageState.mm
index 2fdcf83..c218c15 100644
--- a/WebCore/kwq/KWQPageState.mm
+++ b/WebCore/kwq/KWQPageState.mm
@@ -53,7 +53,6 @@ using KJS::SavedProperties;
     URL = new KURL(u);
     windowProperties = wp;
     locationProperties = lp;
-    
     return self;
 }
 

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list