Hi all :) I am developing a simple rotator client that takes a few arguments, connects to the rotator (currently a simulator), and it should just exit the program after reaching its destination. However, if I simply use 

exit(0);
after reaching the destination the program complains
BaseClient::~BaseClient: Probability of detecting a deadlock.

I am wondering what is the clean way to exit the program after reaching certain conditions without the need of human intervention? Should I just write a `while(true)` loop and check for conditions in the `main` function? If so, I am worried about blocking the CPU. Should I be worried?

Thanks in advance,
Pedram
[color=#66d9ef]int[/color][color=#f8f8f2] [/color][color=#a6e22e]main[/color][color=#f8f8f2]([/color][color=#66d9ef]int[/color][color=#f8f8f2] [/color][color=#fd971f]argc[/color][color=#f8f8f2], [/color][color=#66d9ef]char[/color][color=#f8f8f2] [/color][color=#f92672]**[/color][color=#fd971f]argv[/color][color=#f8f8f2])[/color][color=#f8f8f2]{[/color][color=#f8f8f2]rotator_client->[/color][color=#a6e22e]setServer[/color][color=#f8f8f2]([/color][color=#e6db74]"localhost"[/color][color=#f8f8f2], [/color][color=#ae81ff]7624[/color][color=#f8f8f2]);[/color][color=#f8f8f2]rotator_client->[/color][color=#a6e22e]watchDevice[/color][color=#f8f8f2](arguments.device_name);[/color][color=#f8f8f2]rotator_client->[/color][color=#a6e22e]connectServer[/color][color=#f8f8f2]();[/color] [color=#f8f8f2]cout [/color][color=#f92672]<<[/color][color=#f8f8f2] [/color][color=#e6db74]"Press any key to terminate the client.[/color][color=#ae81ff]\n[/color][color=#e6db74]"[/color][color=#f8f8f2];[/color][color=#a6e22e]std[/color][color=#f8f8f2]::cin.[/color][color=#a6e22e]ignore[/color][color=#f8f8f2](); // <---------- what should I replace this line with?
// a while loop?[/color] [color=#f8f8f2]rotator_client->[/color][color=#a6e22e]disconnectServer[/color][color=#f8f8f2]();[/color][color=#f8f8f2]}[/color]


Read More...