diff --git a/ecmascript/dfx/hprof/rawheap_translate/metadata_parse.cpp b/ecmascript/dfx/hprof/rawheap_translate/metadata_parse.cpp index 13fbb0c76b9af8d23c4d7cee21d218756370ca9d..62c484ec80e026a36f828ad5de834dd0ca22a8f6 100644 --- a/ecmascript/dfx/hprof/rawheap_translate/metadata_parse.cpp +++ b/ecmascript/dfx/hprof/rawheap_translate/metadata_parse.cpp @@ -18,10 +18,10 @@ namespace rawheap_translate { bool Meta::Parse(const cJSON *object) { - return ParseTypeEnums(object) && + return ParseVersion(object) && + ParseTypeEnums(object) && ParseTypeList(object) && ParseTypeLayout(object) && - ParseVersion(object) && SetObjTypeBitFieldOffset() && SetNativatePointerBindingSizeOffset(); } diff --git a/ecmascript/dfx/hprof/rawheap_translate/serializer.cpp b/ecmascript/dfx/hprof/rawheap_translate/serializer.cpp index 9e035e36a9e7feb58b0fd4acc8933b8499e0dce6..4990ae641f141fec51b586e4cd95f5241b91dd13 100644 --- a/ecmascript/dfx/hprof/rawheap_translate/serializer.cpp +++ b/ecmascript/dfx/hprof/rawheap_translate/serializer.cpp @@ -65,6 +65,9 @@ void StreamWriter::EndOfStream() fileStream_ << str; current_ = 0; } + if (fileStream_.is_open()) { + fileStream_.close(); + } } bool HeapSnapshotJSONSerializer::Serialize(RawHeapTranslate *snapshot, StreamWriter *writer)