Revert 44bee4e (wrong fix) and add warning on window registration fail

This commit is contained in:
Charles Dang 2017-05-30 04:31:18 +11:00
parent 6c35ea3ec1
commit 3ee79ff12f

View file

@ -433,7 +433,10 @@ static auto default_gui = guis.end();
void register_window(const std::string& id) void register_window(const std::string& id)
{ {
registered_window_types().insert(id); // The second value of emplace is the 'was successfully added' flag.
if(!registered_window_types().emplace(id).second) {
WRN_GUI_P << "Window '" << id "' already registered. Ignoring." << std::endl;
}
} }
std::set<std::string> unit_test_access_only::get_registered_window_list() std::set<std::string> unit_test_access_only::get_registered_window_list()