Skip to content

Commit

Permalink
fixing iterator bug
Browse files Browse the repository at this point in the history
  • Loading branch information
degloff committed Apr 14, 2024
1 parent 63ed6d4 commit 12e1ecb
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
5 changes: 4 additions & 1 deletion fix_simulation_server/application.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -102,11 +102,14 @@ void Application::onLogout(const FIX::SessionID& sessionID)
"====> removing market data subscriptions for senderCompID = {} targetCompID = {}",
senderCompID, targetCompID
);
for (; it != market_data_subscriptions.end(); ++it) {
while(it != market_data_subscriptions.end()) {
if (senderCompID == it->second.first && targetCompID == it->second.second) {
spdlog::info("removing subscription for symbol={}", it->first);
it = market_data_subscriptions.erase(it);
}
else {
++it;
}
}
}

Expand Down
6 changes: 3 additions & 3 deletions zorro_fix_plugin/zorro_fix_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -569,12 +569,12 @@ namespace zfix {
if (it != order_id_by_internal_order_id.end()) {
auto [oit, success] = order_tracker.get_open_order(it->second);

spdlog::debug("BrokerSell2: found open order={}", oit->second.to_string());
show(std::format("BrokerSell2: found open order={}", oit->second.to_string()));

if (success) {
auto& order = oit->second;

spdlog::debug("BrokerSell2: found open order={}", order.to_string());
show(std::format("BrokerSell2: found open order={}", order.to_string()));

if (order.ord_status == FIX::OrdStatus_FILLED) {
double close_price;
int close_fill;
Expand Down

0 comments on commit 12e1ecb

Please sign in to comment.