Skip to content

Commit

Permalink
Fix issues reported by valgrind (#2017)
Browse files Browse the repository at this point in the history
* Fix issues with debug statements whilst running exit handlers

* Fix issue with `TcpConnection::checkSelfFree()` being called twice

Reported in #2007 (comment) and #2016
  • Loading branch information
mikee47 authored and slaff committed Jan 6, 2020
1 parent ca120a3 commit e96d46f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
3 changes: 3 additions & 0 deletions Sming/Arch/Host/Components/hostlib/startup.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -255,5 +255,8 @@ int main(int argc, char* argv[])

pause(config.exitpause);

// Avoid issues with debug statements whilst running exit handlers
m_setPuts(nullptr);

return exitCode;
}
7 changes: 3 additions & 4 deletions Sming/Core/Network/TcpConnection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -499,12 +499,11 @@ err_t TcpConnection::staticOnPoll(void* arg, tcp_pcb* tcp)

err_t TcpConnection::internalOnPoll()
{
//if (tcp->state != ESTABLISHED)
// return ERR_OK;

sleep++;
err_t res = onPoll();
checkSelfFree();
if(res == ERR_OK) {
checkSelfFree();
}
debug_tcp_ext("<poll");
return res;
}
Expand Down

0 comments on commit e96d46f

Please sign in to comment.