mirror of
				https://github.com/RGBCube/serenity
				synced 2025-10-30 23:52:43 +00:00 
			
		
		
		
	 96f409ec1e
			
		
	
	
		96f409ec1e
		
	
	
	
	
		
			
			There is currently a memory leak with these file request objects due to the callback on_file_request_finish referencing itself in its capture list. This object does not need to be reference counted or allocated on the heap. It is only ever stored in a HashMap until a response is received from the browser, and it is not shared.
		
			
				
	
	
		
			22 lines
		
	
	
	
		
			433 B
		
	
	
	
		
			C++
		
	
	
	
	
	
			
		
		
	
	
			22 lines
		
	
	
	
		
			433 B
		
	
	
	
		
			C++
		
	
	
	
	
	
| /*
 | |
|  * Copyright (c) 2022, Lucas Chollet <lucas.chollet@free.fr>
 | |
|  *
 | |
|  * SPDX-License-Identifier: BSD-2-Clause
 | |
|  */
 | |
| 
 | |
| #include "FileRequest.h"
 | |
| 
 | |
| namespace Web {
 | |
| 
 | |
| FileRequest::FileRequest(DeprecatedString path, Function<void(ErrorOr<i32>)> on_file_request_finish_callback)
 | |
|     : on_file_request_finish(move(on_file_request_finish_callback))
 | |
|     , m_path(move(path))
 | |
| {
 | |
| }
 | |
| 
 | |
| DeprecatedString FileRequest::path() const
 | |
| {
 | |
|     return m_path;
 | |
| }
 | |
| 
 | |
| }
 |