Skip to content

Commit ca55099

Browse files
committed
Moved PDHG_Destroy(&w); to eliminate unassigned read in CupslpWrapper.cpp
1 parent 900e2d5 commit ca55099

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

highs/pdlp/CupdlpWrapper.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,11 @@ HighsStatus solveLpCupdlp(const HighsOptions& options, HighsTimer& timer,
210210
highs_solution.col_value.data(), lp.num_col_,
211211
highs_solution.row_dual.data(), lp.num_row_);
212212
if (w->debug_pdlp_log_file_) fclose(w->debug_pdlp_log_file_);
213+
// Moved this from LP_SolvePDHG so w->debug_pdlp_log_file_ can
214+
// still be used
215+
//
216+
PDHG_Destroy(&w);
217+
213218
model_status = HighsModelStatus::kUnknown;
214219
highs_solution.value_valid = value_valid;
215220
highs_solution.dual_valid = dual_valid;

highs/pdlp/cupdlp/cupdlp_solver.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1476,6 +1476,9 @@ cupdlp_retcode LP_SolvePDHG(
14761476
}
14771477

14781478
exit_cleanup:
1479-
PDHG_Destroy(&pdhg);
1479+
// Move this to CupdlpWrapper so pdhg->debug_pdlp_log_file_ can
1480+
// still be used
1481+
//
1482+
// PDHG_Destroy(&pdhg);
14801483
return retcode;
14811484
}

0 commit comments

Comments
 (0)