Make sure the wiiload thread is cleaned up

This commit is contained in:
Maschell 2022-10-05 18:43:37 +02:00
parent a0ad379b95
commit 03b9a7a928

View File

@ -24,13 +24,6 @@ INITIALIZE_PLUGIN() {
}
}
/* Entry point */
ON_APPLICATION_START() {
initLogging();
DEBUG_FUNCTION_LINE("Start wiiload thread");
thread = new TcpReceiver(4299);
}
void stopThread() {
if (thread != nullptr) {
delete thread;
@ -38,6 +31,16 @@ void stopThread() {
}
}
/* Entry point */
ON_APPLICATION_START() {
initLogging();
stopThread();
DEBUG_FUNCTION_LINE("Start wiiload thread");
thread = new TcpReceiver(4299);
}
ON_APPLICATION_REQUESTS_EXIT() {
DEBUG_FUNCTION_LINE("Stop wiiload thread");
stopThread();