Browse Source

fix(sdk/load_and_run): fix ciruclar dependency in DataPaser::Brace

GitOrigin-RevId: d07f8c19b2
tags/v0.5.0
Megvii Engine Team Xinran Xu 5 years ago
parent
commit
3d9d4b9beb
1 changed files with 2 additions and 4 deletions
  1. +2
    -4
      sdk/load-and-run/src/mgblar.cpp

+ 2
- 4
sdk/load-and-run/src/mgblar.cpp View File

@@ -194,9 +194,7 @@ R"__usage__(


struct DataParser { struct DataParser {
struct Brace { struct Brace {
Brace() { parent = nullptr; }

std::shared_ptr<Brace> parent;
std::weak_ptr<Brace> parent;
std::vector<std::shared_ptr<Brace>> chidren; std::vector<std::shared_ptr<Brace>> chidren;
}; };


@@ -397,7 +395,7 @@ private:
cur->chidren.emplace_back(child); cur->chidren.emplace_back(child);
cur = child; cur = child;
} else if (c == ']') { } else if (c == ']') {
cur = cur->parent;
cur = cur->parent.lock();
} else if (c == ',') { } else if (c == ',') {
number_cnt++; number_cnt++;
} }


Loading…
Cancel
Save