diff --git a/src/main.cpp b/src/main.cpp index 2babf59..3f533a1 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -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();