Index: Source/core/xml/parser/XMLDocumentParser.cpp |
diff --git a/Source/core/xml/parser/XMLDocumentParser.cpp b/Source/core/xml/parser/XMLDocumentParser.cpp |
index 26f839d28cde255669a90781a13101210d401d3f..a06e969bb2268ae7687e4797e8b9355e8bd25933 100644 |
--- a/Source/core/xml/parser/XMLDocumentParser.cpp |
+++ b/Source/core/xml/parser/XMLDocumentParser.cpp |
@@ -350,6 +350,10 @@ void XMLDocumentParser::append(PassRefPtr<StringImpl> inputSource) |
return; |
} |
+ // JavaScript can detach the parser. Make sure this is not released |
+ // before the end of this method. |
+ RefPtr<XMLDocumentParser> protect(this); |
+ |
doWrite(source.toString()); |
if (isStopped()) |