mirror of
				https://github.com/ciphervance/supercell-wx.git
				synced 2025-10-31 05:20:06 +00:00 
			
		
		
		
	Hold reference to radar product manager for duration of request
- Avoids early destruction and potential recursive mutex locking
This commit is contained in:
		
							parent
							
								
									2a12b603fc
								
							
						
					
					
						commit
						5caf0edf95
					
				
					 2 changed files with 10 additions and 7 deletions
				
			
		|  | @ -1,4 +1,5 @@ | |||
| #include <scwx/qt/request/nexrad_file_request.hpp> | ||||
| #include <scwx/qt/config/radar_site.hpp> | ||||
| 
 | ||||
| namespace scwx | ||||
| { | ||||
|  | @ -13,12 +14,15 @@ class NexradFileRequest::Impl | |||
| { | ||||
| public: | ||||
|    explicit Impl(const std::string& currentRadarSite) : | ||||
|        currentRadarSite_ {currentRadarSite} | ||||
|        currentRadarSiteId_ {currentRadarSite} | ||||
|    { | ||||
|       // Hold shared pointer to radar site for duration of reqest
 | ||||
|       currentRadarSite_ = config::RadarSite::Get(currentRadarSite); | ||||
|    } | ||||
|    ~Impl() = default; | ||||
| 
 | ||||
|    const std::string currentRadarSite_; | ||||
|    const std::string                  currentRadarSiteId_; | ||||
|    std::shared_ptr<config::RadarSite> currentRadarSite_ {}; | ||||
| 
 | ||||
|    std::shared_ptr<types::RadarProductRecord> radarProductRecord_ {nullptr}; | ||||
| }; | ||||
|  | @ -31,7 +35,7 @@ NexradFileRequest::~NexradFileRequest() = default; | |||
| 
 | ||||
| std::string NexradFileRequest::current_radar_site() const | ||||
| { | ||||
|    return p->currentRadarSite_; | ||||
|    return p->currentRadarSiteId_; | ||||
| } | ||||
| 
 | ||||
| std::shared_ptr<types::RadarProductRecord> | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Dan Paulat
						Dan Paulat