main: catch exception, to finish cleanly
This commit is contained in:
parent
ad50f1a19b
commit
849e5751e0
11
src/main.cpp
11
src/main.cpp
|
|
@ -170,8 +170,15 @@ int main(int argc, char **argv)
|
||||||
return EXIT_FAILURE;
|
return EXIT_FAILURE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!args.bit_file.empty())
|
if (!args.bit_file.empty()) {
|
||||||
fpga->program(args.offset);
|
try {
|
||||||
|
fpga->program(args.offset);
|
||||||
|
} catch (std::exception &e) {
|
||||||
|
delete(fpga);
|
||||||
|
delete(jtag);
|
||||||
|
return EXIT_FAILURE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (args.reset)
|
if (args.reset)
|
||||||
fpga->reset();
|
fpga->reset();
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue