Add uWS::destroy() helper function

This commit is contained in:
Alex Hultman
2018-12-30 21:19:08 +01:00
parent 7afb3af614
commit b65e9fd7d8
2 changed files with 7 additions and 1 deletions
+2 -1
View File
@@ -67,7 +67,8 @@ int main(int argc, char **argv) {
}
}).run();
uWS::Loop::defaultLoop()->free();
/* This is needed to properly free default loop and such resources */
uWS::destroy();
std::cout << "Everything fine, falling through" << std::endl;
+5
View File
@@ -145,6 +145,11 @@ inline void run() {
Loop::defaultLoop()->run();
}
/* Helper to clean up a thead before exiting */
inline void destroy() {
Loop::defaultLoop()->free();
}
}
#endif // LOOP_H