Commit 21518f1a authored by Gabriel Margiani's avatar Gabriel Margiani
Browse files

wait for calls to close when shutting down

parent baee4ee7
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -18,6 +18,7 @@

#include <iostream>
#include <cstdlib>
#include <chrono>

#include "server.h"

@@ -55,6 +56,9 @@ p3::server::server() :

p3::server::~server() {
	phone.hangup_all();
	while (phone.get_call_count()) {
		std::this_thread::sleep_for(std::chrono::milliseconds(200));
	}
	finish_threads();
}