...
 
......@@ -64,6 +64,12 @@ public:
bool isPaused() {
return paused;
}
void clearCallbacks()
{
dataCallback = nullptr;
discoverCallback = nullptr;
}
private:
bool started = false;
......
......@@ -99,6 +99,7 @@ void BroadcastServer::startDiscover()
void BroadcastServer::stopDiscover()
{
paused = true;
clearCallbacks();
}
void BroadcastServer::sendPacket(enet_uint32 host, const std::string &data)
......
......@@ -96,6 +96,12 @@ public:
void sendPacket(enet_uint32 host, const std::string &data);
void clearCallbacks()
{
dataCallback = nullptr;
discoverCallback = nullptr;
}
private:
bool started = false;
bool paused = true;
......