Fix memory leak in XInstance::getTopLevelWindows
This commit is contained in:
		
							parent
							
								
									bdcd27eb95
								
							
						
					
					
						commit
						8c69a02e5d
					
				
					 3 changed files with 7 additions and 3 deletions
				
			
		|  | @ -25,7 +25,7 @@ struct Config | |||
|     bool ignoreClientMachine = false; | ||||
| }; | ||||
| 
 | ||||
| const char *argp_program_version = "1.0.3"; | ||||
| const char *argp_program_version = "1.0.4"; | ||||
| const char *argp_program_bug_address = "<carl@uvos.xyz>"; | ||||
| static char doc[] = "Deamon that stops programms via SIGSTOP when their X11 windows lose focus."; | ||||
| static char args_doc[] = ""; | ||||
|  |  | |||
							
								
								
									
										4
									
								
								debian/changelog
									
										
									
									
										vendored
									
									
								
							
							
						
						
									
										4
									
								
								debian/changelog
									
										
									
									
										vendored
									
									
								
							|  | @ -1,3 +1,7 @@ | |||
| sigstoped (1.0.4) unstable; urgency=medium | ||||
|   Fix memory leak in XInstance::getTopLevelWindows() | ||||
|  -- Uvos <carl@uvos.xyz>  Mon, 16 Jun 2020 09:47:00 +0100 | ||||
| 
 | ||||
| sigstoped (1.0.3) unstable; urgency=medium | ||||
|   Ignore BadWindow errors caused by faulty __NET_ACTIVE_WINDOW events | ||||
|  -- Uvos <carl@uvos.xyz>  Mon, 15 Jun 2020 23:47:00 +0100 | ||||
|  |  | |||
|  | @ -107,13 +107,13 @@ std::vector<Window> XInstance::getTopLevelWindows() | |||
|     Window* windows = nullptr; | ||||
|     unsigned int nwindows; | ||||
|     XQueryTree(display, RootWindow(display, screen), &root_return, &parent_return, &windows, &nwindows); | ||||
|      | ||||
|     std::vector<Window> out; | ||||
|     out.reserve(nwindows); | ||||
|     for(unsigned int i; i < nwindows; ++i) | ||||
|     for(unsigned int i = 0; i < nwindows; ++i) | ||||
|     { | ||||
|         out.push_back(windows[i]); | ||||
|     } | ||||
|     if(windows != nullptr) XFree(windows); | ||||
|     return out; | ||||
| } | ||||
| 
 | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue