sources/main.cpp

changeset 59
00a084f8ed26
parent 58
d175243ad169
child 72
1b9c53e0c846
--- a/sources/main.cpp	Tue Dec 16 02:48:18 2014 +0200
+++ b/sources/main.cpp	Tue Dec 16 03:27:54 2014 +0200
@@ -64,11 +64,9 @@
 			timeout.tv_usec = 250000; // 0.25 seconds
 			FD_ZERO (&fdset);
 			FD_SET (0, &fdset);
-			RCONSession* session = RCONSession::get_session();
 
-			if (session)
 			{
-				int fd = session->socket()->file_descriptor();
+				int fd = RCONSession::get_session()->socket()->file_descriptor();
 				highest = max (highest, fd);
 				FD_SET (fd, &fdset);
 			}
@@ -79,16 +77,12 @@
 				// stdin is ready, what's incoming?
 				Interface::handle_input();
 
-			if (session)
-				session->tick();
-
+			RCONSession::get_session()->tick();
 			Interface::render();
 		}
 	}
 	catch (const Exitception&) {}
 
-	if (RCONSession::get_session())
-		RCONSession::get_session()->disconnect();
-
+	RCONSession::get_session()->disconnect();
 	return EXIT_SUCCESS;
 }

mercurial