diff --git a/fm_transmitter.cpp b/fm_transmitter.cpp index c919a9d..131de22 100644 --- a/fm_transmitter.cpp +++ b/fm_transmitter.cpp @@ -87,8 +87,9 @@ int main(int argc, char** argv) std::signal(SIGTSTP, sigIntHandler); auto finally = [&]() { - delete transmitter; + auto temp = transmitter; transmitter = nullptr; + delete temp; }; try { transmitter = new Transmitter();