event/ServerSocket: close only sockets that have been opened
Fixes assertion failure.
This commit is contained in:
		| @@ -98,6 +98,7 @@ public: | |||||||
|  |  | ||||||
| 	bool Open(GError **error_r); | 	bool Open(GError **error_r); | ||||||
|  |  | ||||||
|  | 	using SocketMonitor::IsDefined; | ||||||
| 	using SocketMonitor::Close; | 	using SocketMonitor::Close; | ||||||
|  |  | ||||||
| 	char *ToString() const; | 	char *ToString() const; | ||||||
| @@ -286,7 +287,8 @@ void | |||||||
| ServerSocket::Close() | ServerSocket::Close() | ||||||
| { | { | ||||||
| 	for (auto &i : sockets) | 	for (auto &i : sockets) | ||||||
| 		i.Close(); | 		if (i.IsDefined()) | ||||||
|  | 			i.Close(); | ||||||
| } | } | ||||||
|  |  | ||||||
| OneServerSocket & | OneServerSocket & | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Max Kellermann
					Max Kellermann