Firmware updater: Fix a race condition

avrdude: Handle OOM with configurable handler
This commit is contained in:
Vojtech Kral 2018-08-07 11:28:39 +02:00 committed by bubnikv
parent bd667aad6e
commit 60a0375ff9
14 changed files with 193 additions and 67 deletions

View file

@ -551,8 +551,10 @@ void FirmwareDialog::priv::perform_upload()
// because the dialog ensures it doesn't exit before the background thread is done.
auto q = this->q;
this->avrdude = avrdude
.on_run([this]() {
avrdude
.on_run([this](AvrDude::Ptr avrdude) {
this->avrdude = std::move(avrdude);
try {
switch (this->hex_file.device) {
case HexFile::DEV_MK3: