mirror of
				https://github.com/ciphervance/supercell-wx.git
				synced 2025-10-31 12:00:04 +00:00 
			
		
		
		
	Fix: selected time is uninitialized on layer initialization
This commit is contained in:
		
							parent
							
								
									3ba569354e
								
							
						
					
					
						commit
						2f2516b998
					
				
					 4 changed files with 11 additions and 0 deletions
				
			
		|  | @ -112,6 +112,11 @@ public: | ||||||
| TimelineManager::TimelineManager() : p(std::make_unique<Impl>(this)) {} | TimelineManager::TimelineManager() : p(std::make_unique<Impl>(this)) {} | ||||||
| TimelineManager::~TimelineManager() = default; | TimelineManager::~TimelineManager() = default; | ||||||
| 
 | 
 | ||||||
|  | std::chrono::system_clock::time_point TimelineManager::GetSelectedTime() const | ||||||
|  | { | ||||||
|  |    return p->selectedTime_; | ||||||
|  | } | ||||||
|  | 
 | ||||||
| void TimelineManager::SetMapCount(std::size_t mapCount) | void TimelineManager::SetMapCount(std::size_t mapCount) | ||||||
| { | { | ||||||
|    p->mapCount_ = mapCount; |    p->mapCount_ = mapCount; | ||||||
|  |  | ||||||
|  | @ -24,6 +24,8 @@ public: | ||||||
| 
 | 
 | ||||||
|    static std::shared_ptr<TimelineManager> Instance(); |    static std::shared_ptr<TimelineManager> Instance(); | ||||||
| 
 | 
 | ||||||
|  |    std::chrono::system_clock::time_point GetSelectedTime() const; | ||||||
|  | 
 | ||||||
|    void SetMapCount(std::size_t mapCount); |    void SetMapCount(std::size_t mapCount); | ||||||
| 
 | 
 | ||||||
| public slots: | public slots: | ||||||
|  |  | ||||||
|  | @ -268,6 +268,8 @@ void AlertLayer::Initialize() | ||||||
| 
 | 
 | ||||||
|    auto& alertLayerHandler = AlertLayerHandler::Instance(); |    auto& alertLayerHandler = AlertLayerHandler::Instance(); | ||||||
| 
 | 
 | ||||||
|  |    p->selectedTime_ = manager::TimelineManager::Instance()->GetSelectedTime(); | ||||||
|  | 
 | ||||||
|    // Take a shared lock to prevent handling additional alerts while populating
 |    // Take a shared lock to prevent handling additional alerts while populating
 | ||||||
|    // initial lists
 |    // initial lists
 | ||||||
|    std::shared_lock lock {alertLayerHandler.alertMutex_}; |    std::shared_lock lock {alertLayerHandler.alertMutex_}; | ||||||
|  |  | ||||||
|  | @ -122,6 +122,8 @@ void PlacefileLayer::Initialize() | ||||||
|    logger_->debug("Initialize()"); |    logger_->debug("Initialize()"); | ||||||
| 
 | 
 | ||||||
|    DrawLayer::Initialize(); |    DrawLayer::Initialize(); | ||||||
|  | 
 | ||||||
|  |    p->selectedTime_ = manager::TimelineManager::Instance()->GetSelectedTime(); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| void PlacefileLayer::Render( | void PlacefileLayer::Render( | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Dan Paulat
						Dan Paulat