Limit returned MBOSnapshot size to avoid memory leaking

This commit is contained in:
Eric Harding committed 2019-04-24 14:12:50 -04:00
1 parent 34401960f9
commit f65f34c2fe
1 file changed
+7
+7
View File
@@ -41,6 +41,13 @@ struct MBOSnapshot {
void reset() {
updated = utils::TimeStamp();
constexpr int max = 256;
if (bids.size() > max) {
bids.resize(max);
}
if (asks.size() > max) {
asks.resize(max);
}
bids.clear();
asks.clear();
}