Add uWS::destroy() helper function
This commit is contained in:
+2
-1
@@ -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;
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user