From 2b69ded1eabf56e6b5426da1085568689a40df8c Mon Sep 17 00:00:00 2001 From: Edward Hennis Date: Tue, 19 Aug 2014 17:14:19 -0400 Subject: [PATCH] Convert rvalue to an lvalue. (RIPD-494) * The rvalue gets destructed as soon as "rc" is constructed. --- src/ripple/module/app/paths/Pathfinder.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/ripple/module/app/paths/Pathfinder.cpp b/src/ripple/module/app/paths/Pathfinder.cpp index 2d7d07d67..fb78a56ab 100644 --- a/src/ripple/module/app/paths/Pathfinder.cpp +++ b/src/ripple/module/app/paths/Pathfinder.cpp @@ -270,13 +270,15 @@ STPathSet Pathfinder::filterPaths(int iMaxPaths, STPath& extraPath) try { LedgerEntrySet lesSandbox (mLedger, tapNONE); + // Need a lvalue here. An rvalue will be destructed as soon as the RippleCalc ctor ends. + STPathSet spsPaths; path::RippleCalc rc( lesSandbox, mSrcAmount, mDstAmount, mDstAccountID, mSrcAccountID, - STPathSet ()); + spsPaths); rc.partialPaymentAllowed_ = true; TER result = rc.rippleCalculate ();