Skip to content

Commit

Permalink
clear up the doc comment confusion
Browse files Browse the repository at this point in the history
  • Loading branch information
mariocynicys committed Jan 22, 2025
1 parent dd5418f commit 64a0012
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions mm2src/mm2_main/src/lp_native_dex.rs
Original file line number Diff line number Diff line change
Expand Up @@ -536,6 +536,7 @@ pub async fn lp_init(ctx: MmArc, version: String, datetime: String) -> MmInitRes
};
Timer::sleep(0.2).await
}
// Clearing up the running swaps removes any circular references that might prevent the context from being dropped.
lp_swap::clear_running_swaps(&ctx);

Ok(())
Expand Down
2 changes: 1 addition & 1 deletion mm2src/mm2_main/src/lp_swap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -656,7 +656,7 @@ pub fn get_locked_amount(ctx: &MmArc, coin: &str) -> MmNumber {

/// Clear up all the running swaps.
///
/// This also auto-stops any running swaps since their abort handles will get triggered (assuming these abort handles aren't already triggered by other means).
/// This doesn't mean that these swaps will be stopped. They can only be stopped from the abortable systems they are running on top of.
pub fn clear_running_swaps(ctx: &MmArc) {
let swap_ctx = SwapsContext::from_ctx(ctx).unwrap();
swap_ctx.running_swaps.lock().unwrap().clear();
Expand Down

0 comments on commit 64a0012

Please sign in to comment.