Commit c3558a481763f351a2654f144f7d3e4af98e1b77

Authored by Bryan Dallas
1 parent ddaac7a7

Fix so that we only read from each atomic variable once instead of twice. This w…

…ill make debugging easier if the error condition does occur.
Showing 1 changed file with 5 additions and 3 deletions
src/client.cpp
@@ -334,9 +334,11 @@ void Redox::runEventLoop() { @@ -334,9 +334,11 @@ void Redox::runEventLoop() {
334 // Run once more to disconnect 334 // Run once more to disconnect
335 ev_run(evloop_, EVRUN_NOWAIT); 335 ev_run(evloop_, EVRUN_NOWAIT);
336 336
337 - if (commands_created_ != commands_deleted_) {  
338 - logger_.error() << "All commands were not freed! " << commands_deleted_ << "/"  
339 - << commands_created_; 337 + long created = commands_created_;
  338 + long deleted = commands_deleted_;
  339 + if (created != deleted) {
  340 + logger_.error() << "All commands were not freed! " << deleted << "/"
  341 + << created;
340 } 342 }
341 343
342 { 344 {