diff options
Diffstat (limited to 'pacman-c++/server')
| -rw-r--r-- | pacman-c++/server/server.cpp | 10 | ||||
| -rw-r--r-- | pacman-c++/server/server.pro | 4 |
2 files changed, 12 insertions, 2 deletions
diff --git a/pacman-c++/server/server.cpp b/pacman-c++/server/server.cpp index c9e4fff..65db87d 100644 --- a/pacman-c++/server/server.cpp +++ b/pacman-c++/server/server.cpp | |||
| @@ -38,7 +38,7 @@ Server::~Server() | |||
| 38 | break; | 38 | break; |
| 39 | case ENET_EVENT_TYPE_DISCONNECT: | 39 | case ENET_EVENT_TYPE_DISCONNECT: |
| 40 | m_clientConnections.remove(event.peer); | 40 | m_clientConnections.remove(event.peer); |
| 41 | return; | 41 | break; |
| 42 | default: | 42 | default: |
| 43 | break; | 43 | break; |
| 44 | } | 44 | } |
| @@ -949,6 +949,12 @@ int main(int argc, char **argv) | |||
| 949 | */ | 949 | */ |
| 950 | GOOGLE_PROTOBUF_VERIFY_VERSION; | 950 | GOOGLE_PROTOBUF_VERIFY_VERSION; |
| 951 | 951 | ||
| 952 | if (enet_initialize () != 0) | ||
| 953 | { | ||
| 954 | qCritical() << "An error occurred while initializing ENet"; | ||
| 955 | return EXIT_FAILURE; | ||
| 956 | } | ||
| 957 | |||
| 952 | QApplication app(argc, argv, false); | 958 | QApplication app(argc, argv, false); |
| 953 | app.setApplicationName("Pacman Server"); | 959 | app.setApplicationName("Pacman Server"); |
| 954 | app.setWindowIcon(QIcon(":/appicon")); | 960 | app.setWindowIcon(QIcon(":/appicon")); |
| @@ -964,6 +970,8 @@ int main(int argc, char **argv) | |||
| 964 | if (!ret) | 970 | if (!ret) |
| 965 | ret = app.exec(); | 971 | ret = app.exec(); |
| 966 | 972 | ||
| 973 | enet_deinitialize(); | ||
| 974 | |||
| 967 | /* Delete all global objects allocated by libprotobuf */ | 975 | /* Delete all global objects allocated by libprotobuf */ |
| 968 | google::protobuf::ShutdownProtobufLibrary(); | 976 | google::protobuf::ShutdownProtobufLibrary(); |
| 969 | 977 | ||
diff --git a/pacman-c++/server/server.pro b/pacman-c++/server/server.pro index 05d5c9d..b5a9952 100644 --- a/pacman-c++/server/server.pro +++ b/pacman-c++/server/server.pro | |||
| @@ -7,4 +7,6 @@ HEADERS += anyoption.h \ | |||
| 7 | server.h | 7 | server.h |
| 8 | 8 | ||
| 9 | include(../common.pri) | 9 | include(../common.pri) |
| 10 | PRE_TARGETDEPS += ../common/libcommon.a | 10 | PRE_TARGETDEPS += ../libcommon.a |
| 11 | |||
| 12 | win32:RC_FILE = ../common/pacman.rc | ||
