Changeset - 631bd92de9b7
[Not reviewed]
0 1 0
HanzZ - 13 years ago 2013-02-12 21:43:34
hanzz.k@gmail.com
Skype: Try to ShutdownProtobufLibrary() before exit
1 file changed with 4 insertions and 0 deletions:
0 comments (0 inline, 0 general)
backends/skype/skypeplugin.cpp
Show inline comments
 
@@ -53,12 +53,13 @@ static gboolean transportDataReceived(GIOChannel *source, GIOCondition condition
 
	char buffer[65535];
 
	char *ptr = buffer;
 
	ssize_t n = read(m_sock, ptr, sizeof(buffer));
 
	if (n <= 0) {
 
		LOG4CXX_INFO(logger, "Diconnecting from spectrum2 server");
 
		Logging::shutdownLogging();
 
		google::protobuf::ShutdownProtobufLibrary();
 
		exit(errno);
 
	}
 
	std::string d = std::string(buffer, n);
 
	np->handleDataRead(d);
 
	return TRUE;
 
}
 
@@ -73,12 +74,13 @@ static int create_socket(const char *host, int portno) {
 

	
 
	hostent *hos;  // Resolve name
 
	if ((hos = gethostbyname(host)) == NULL) {
 
		// strerror() will not work for gethostbyname() and hstrerror() 
 
		// is supposedly obsolete
 
		Logging::shutdownLogging();
 
		google::protobuf::ShutdownProtobufLibrary();
 
		exit(1);
 
	}
 
	serv_addr.sin_addr.s_addr = *((unsigned long *) hos->h_addr_list[0]);
 

	
 
	if (connect(m_sock, (struct sockaddr *) &serv_addr, sizeof(serv_addr)) < 0) {
 
		close(m_sock);
 
@@ -90,12 +92,13 @@ static int create_socket(const char *host, int portno) {
 
	fcntl(m_sock, F_SETFL, flags);
 
	return m_sock;
 
}
 

	
 
static void io_destroy(gpointer data) {
 
	Logging::shutdownLogging();
 
	google::protobuf::ShutdownProtobufLibrary();
 
	exit(1);
 
}
 

	
 
SkypePlugin::SkypePlugin(Config *config, const std::string &host, int port) : NetworkPlugin() {
 
	this->config = config;
 
	LOG4CXX_INFO(logger, "Starting the backend.");
 
@@ -145,12 +148,13 @@ void SkypePlugin::handleMemoryUsage(double &res, double &shared) {
 
void SkypePlugin::handleLogoutRequest(const std::string &user, const std::string &legacyName) {
 
	Skype *skype = m_sessions[user];
 
	if (skype) {
 
		LOG4CXX_INFO(logger, "User wants to logout, logging out");
 
		skype->logout();
 
		Logging::shutdownLogging();
 
		google::protobuf::ShutdownProtobufLibrary();
 
		exit(1);
 
	}
 
}
 

	
 
void SkypePlugin::handleStatusChangeRequest(const std::string &user, int status, const std::string &statusMessage) {
 
	Skype *skype = m_sessions[user];
0 comments (0 inline, 0 general)