From 03b9a7a92843abf82bc12d0b48458ee197c5a541 Mon Sep 17 00:00:00 2001 From: Maschell Date: Wed, 5 Oct 2022 18:43:37 +0200 Subject: [PATCH] Make sure the wiiload thread is cleaned up --- src/main.cpp | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) 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();