Reviewed by Dave Hyatt.
authorthatcher <thatcher@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 1 Nov 2005 17:33:40 +0000 (17:33 +0000)
committerthatcher <thatcher@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 1 Nov 2005 17:33:40 +0000 (17:33 +0000)
        Commited by Tim Hatcher.

        Fixes http://bugzilla.opendarwin.org/show_bug.cgi?id=5541

        HTMLNames constants are not yet initialized at Safari startup,
        when bookmarks are imported, which caused a crash in Decoder::decode().

        * kwq/WebCoreEncodings.mm:
        (+[WebCoreEncodings decodeData:]):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@11016 268f45cc-cd09-0410-ab3c-d52691b4dbfc

WebCore/ChangeLog-2005-12-19
WebCore/kwq/WebCoreEncodings.mm

index e9fc405d0e624271ad90592e3497e046833451d1..4473be85a48510d3fe955a0cb8856b6217f77c4f 100644 (file)
@@ -1,10 +1,24 @@
+2005-11-01  Alexey Proskuryakov  <ap@nypop.com>
+
+        Reviewed by Dave Hyatt.
+        Commited by Tim Hatcher.
+
+        Fixes http://bugzilla.opendarwin.org/show_bug.cgi?id=5541
+
+        HTMLNames constants are not yet initialized at Safari startup,
+        when bookmarks are imported, which caused a crash in Decoder::decode().
+
+        * kwq/WebCoreEncodings.mm:
+        (+[WebCoreEncodings decodeData:]):
+
 2005-11-01  John Sullivan  <sullivan@apple.com>
 
         Change by Alexey Proskuryakov, reviewed by Darin Adler.
 
         * kwq/KWQKURL.mm:
         (encodeRelativeString):
-        don't use strdup, as it has problems with a curly quote in the string
+        switched to use fastStrdup(), we can't use strdup because we
+        need to use fastFree(), not regular free()
 
 2005-11-01  Anders Carlsson  <andersca@mac.com>
 
index 0cc80e4cb548d86fa2a8c29b2c190aeb89317627..d31289fc6862d4754325d2a070a86a2ef1bcb1ef 100644 (file)
 
 #import "decoder.h"
 
+#include "htmlnames.h"
+
 @implementation WebCoreEncodings
 
 + (NSString *)decodeData:(NSData *)data
 {
+    DOM::HTMLNames::init(); // this method is used for importing bookmarks at startup, so HTMLNames are likely to be uninitialized yet
     khtml::Decoder *decoder = new khtml::Decoder();
     QString result = decoder->decode(static_cast<const char *>([data bytes]), [data length]);
     result += decoder->flush();