mirror of
				https://github.com/ciphervance/supercell-wx.git
				synced 2025-10-31 00:50:05 +00:00 
			
		
		
		
	Add checks to prevent files being saved before being fully read.
This commit is contained in:
		
							parent
							
								
									f3c846f0b1
								
							
						
					
					
						commit
						bc79ed11a3
					
				
					 5 changed files with 31 additions and 1 deletions
				
			
		|  | @ -60,6 +60,8 @@ public: | |||
|    void                          WriteMarkerSettings(); | ||||
|    std::shared_ptr<MarkerRecord> GetMarkerByName(const std::string& name); | ||||
| 
 | ||||
|    bool markerFileRead_ {false}; | ||||
| 
 | ||||
|    void InitalizeIds(); | ||||
|    types::MarkerId NewId(); | ||||
|    types::MarkerId lastId_ {0}; | ||||
|  | @ -209,11 +211,16 @@ void MarkerManager::Impl::ReadMarkerSettings() | |||
|       } | ||||
|    } | ||||
| 
 | ||||
|    markerFileRead_ = true; | ||||
|    Q_EMIT self_->MarkersUpdated(); | ||||
| } | ||||
| 
 | ||||
| void MarkerManager::Impl::WriteMarkerSettings() | ||||
| { | ||||
|    if (!markerFileRead_) | ||||
|    { | ||||
|       return; | ||||
|    } | ||||
|    logger_->info("Saving location marker settings"); | ||||
| 
 | ||||
|    const std::shared_lock lock(markerRecordLock_); | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 AdenKoperczak
						AdenKoperczak