fix startup
This commit is contained in:
+4
-1
@@ -401,8 +401,8 @@ int main(int argc, char* argv[], char* envp[]) {
|
||||
|
||||
// create the MainLoop and start it
|
||||
s_mainLoop = new MainLoop(s_opt, device, s_messageMap, s_scanHelper, s_requestQueue);
|
||||
BusHandler* busHandler = s_mainLoop->getBusHandler();
|
||||
if (s_opt.injectMessages) {
|
||||
BusHandler* busHandler = s_mainLoop->getBusHandler();
|
||||
int scanAdrCount = 0;
|
||||
bool scanAddresses[256] = {};
|
||||
while (arg_index < argc) {
|
||||
@@ -420,6 +420,7 @@ int main(int argc, char* argv[], char* envp[]) {
|
||||
scanAdrCount++;
|
||||
}
|
||||
}
|
||||
busHandler->getProtocol()->start("bushandler");
|
||||
for (symbol_t address = 0; scanAdrCount > 0; address++) {
|
||||
if (scanAddresses[address]) {
|
||||
scanAdrCount--;
|
||||
@@ -430,6 +431,8 @@ int main(int argc, char* argv[], char* envp[]) {
|
||||
shutdown();
|
||||
return 0;
|
||||
}
|
||||
} else {
|
||||
busHandler->getProtocol()->start("bushandler");
|
||||
}
|
||||
s_mainLoop->start("mainloop");
|
||||
|
||||
|
||||
@@ -164,7 +164,6 @@ MainLoop::MainLoop(const struct options& opt, Device *device, MessageMap* messag
|
||||
m_busHandler = new BusHandler(m_device, m_messages, scanHelper,
|
||||
config, opt.pollInterval);
|
||||
m_protocol = m_busHandler->getProtocol();
|
||||
m_protocol->start("bushandler");
|
||||
|
||||
// create network
|
||||
m_htmlPath = opt.htmlPath;
|
||||
|
||||
@@ -245,7 +245,6 @@ class ProtocolHandler : public WaitThread {
|
||||
* Destructor.
|
||||
*/
|
||||
virtual ~ProtocolHandler() {
|
||||
stop();
|
||||
join();
|
||||
BusRequest* req;
|
||||
while ((req = m_finishedRequests.pop()) != nullptr) {
|
||||
|
||||
Reference in New Issue
Block a user