richelbilderbeek / djog_unos_2018

Project by the Uno's at DJOG 2018-2019: Nature Zen
GNU General Public License v3.0
6 stars 2 forks source link

Window manager does not open up a window #606

Closed janderkkotlarski closed 5 years ago

janderkkotlarski commented 5 years ago

PROBLEM: The current code is building fine, but the program crashes hard due to a segmentation fault. I tried fixing it, but due to lack of experience in snooping out and fixing segfaults and in handling the debugger in Qt Creator, I'm a my wits end.

SOLUTION: Somehow search and fix the segmentation fault(s) that make the program crash.

richelbilderbeek commented 5 years ago

OK, I'll take a pass at it :+1:

richelbilderbeek commented 5 years ago

Found the bug. It is in the window manager. I've marked it as such:

  //#define FIX_ISSUE_606
  #ifdef FIX_ISSUE_606
  //A window should have opened up now
  assert(sfml_window_manager::get().get_window().isOpen()); //BUG: Issue #606
  #endif // FIX_ISSUE_606

@Joshua260403: I think you are best to fix this one :1st_place_medal: :+1:

I've put it on develop.

Yep, I've added some std::clog statements. Old-skool, but effective in finding bugs. You can let a junior delete these :+1:

DynCoder commented 5 years ago

Hate to bring it to ya, but your hypothesis was wrong. The assertion passes on my system. The problem was that someone decided it was a good idea to write and activate a test for the not working loading screen. Ran with debugger once, segfault pointing me right at the loading screen. The clogs didn't work because none of them flushed. std::endl is superior after all

janderkkotlarski commented 5 years ago

So I was wrong in assuming it was functions changing one of the vectors of agents or tiles causing the bug and right in giving up...