Making sure the window ptr is not null
This commit is contained in:
		
					parent
					
						
							
								23ddfc4426
							
						
					
				
			
			
				commit
				
					
						eb2bfdfce1
					
				
			
		
					 1 changed files with 4 additions and 2 deletions
				
			
		| 
						 | 
					@ -112,9 +112,11 @@ namespace gui_to_app {
 | 
				
			||||||
    void AppWin2Back::on_quit() noexcept {
 | 
					    void AppWin2Back::on_quit() noexcept {
 | 
				
			||||||
        auto windows = get_windows();
 | 
					        auto windows = get_windows();
 | 
				
			||||||
        for (auto *window: windows) {
 | 
					        for (auto *window: windows) {
 | 
				
			||||||
 | 
					            if (window != nullptr) {
 | 
				
			||||||
                window->set_visible(false);
 | 
					                window->set_visible(false);
 | 
				
			||||||
                delete window;
 | 
					                delete window;
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
        quit();
 | 
					        quit();
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
} // gui_to_app
 | 
					} // gui_to_app
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue