Skip to content

Commit 2974378

Browse files
authored
Easy Setup: Fix crash while displaying Hamlib error. (#1224)
* Easy Setup: Fix crash while displaying Hamlib error. * Add PR #1224 to changelog. * Fix lint error.
1 parent df269c6 commit 2974378

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

USER_MANUAL.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -880,6 +880,7 @@ LDPC | Low Density Parity Check Codes - a family of powerful FEC codes
880880
1. Bugfixes:
881881
* Linux: fix semaphore wakeup timing to reduce audio dropouts. (PR #1220)
882882
* FreeDV Reporter: Fix display issues on non-English systems. (PR #1217)
883+
* Easy Setup: Fix crash while displaying Hamlib error. (PR #1224)
883884
2. Enhancements:
884885
* FreeDV Reporter: Use ItemsAdded/ItemsDeleted instead of Cleared() for performance. (PR #1212)
885886
3. Build system:

src/gui/dialogs/dlg_easy_setup.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -857,8 +857,8 @@ void EasySetupDialog::OnTest(wxCommandEvent&)
857857
auto pttType = (HamlibRigController::PttType)m_cbPttMethod->GetSelection();
858858

859859
hamlibTestObject_ = std::make_shared<HamlibRigController>(rig, (const char*)serialPort.ToUTF8(), rate, civHexAddress, pttType);
860-
hamlibTestObject_->onRigError += [&](IRigController*, std::string error) {
861-
CallAfter([&]() {
860+
hamlibTestObject_->onRigError += [this](IRigController*, std::string error) {
861+
CallAfter([this, error = std::move(error)]() {
862862
wxMessageBox(
863863
wxString::Format("Couldn't connect to Radio with Hamlib (%s). Make sure the Hamlib serial Device, Rate, and Params match your radio", error),
864864
wxT("Error"), wxOK | wxICON_ERROR, this);
@@ -877,7 +877,7 @@ void EasySetupDialog::OnTest(wxCommandEvent&)
877877

878878
if (!wxGetApp().CanAccessSerialPort((const char*)serialPort.ToUTF8()))
879879
{
880-
CallAfter([&]() {
880+
CallAfter([this]() {
881881
wxMessageBox(
882882
"Couldn't connect to Radio. Make sure the serial Device and Params match your radio",
883883
wxT("Error"), wxOK | wxICON_ERROR, this);
@@ -897,8 +897,8 @@ void EasySetupDialog::OnTest(wxCommandEvent&)
897897
useDTR,
898898
DTRPos
899899
);
900-
serialPortTestObject_->onRigError += [&](IRigController*, std::string error) {
901-
CallAfter([&]() {
900+
serialPortTestObject_->onRigError += [this](IRigController*, std::string error) {
901+
CallAfter([this, error = std::move(error)]() {
902902
wxMessageBox(
903903
wxString::Format("Couldn't connect to Radio (%s). Make sure the serial Device and Params match your radio", error),
904904
wxT("Error"), wxOK | wxICON_ERROR, this);

0 commit comments

Comments
 (0)