pthread_mutex_lock(&mutex);
if(socketPair->counter == 2)
{
socketPair->counter--;
if(socketPair->counter == 0)
{
delete socketPair->clientProxySocket;
delete socketPair->proxyServerSocket;
delete socketPair;
}
}
pthread_mutex_unlock(&mutex);
Doing this it didnt crashed at all. I opened many sites including watching video from youtube, from 25 sites that i have in my Speed Dial in Opera only 6 of them didint open, the program didnt crashed, it loads only a few from site than remains block. The strange thing is that all 6 of them are from my country, I didnt find a foreign site that hasnt work. What could be the problem ?
Another anoing think is that now even if I am doing nothing the programs still tries to send() and recv() and gives me errors like :
No error
Error receiving bytes from server
Error in Connect()No error
You are connected !!!
CONNETING TO :127.0.0.1 80
Remote host closed connection
Error receiving bytes from client
Error receiving data
And after this (if i dont do nothing for a few minutes) it doesnt work anymore, i have to stop it and run again.