mirror of
				https://github.com/ciphervance/supercell-wx.git
				synced 2025-10-31 04:00:04 +00:00 
			
		
		
		
	Fix AlertLayer circular reference
This commit is contained in:
		
							parent
							
								
									5e368aaced
								
							
						
					
					
						commit
						a8568d24f6
					
				
					 1 changed files with 11 additions and 4 deletions
				
			
		|  | @ -157,7 +157,7 @@ public: | |||
|       const std::shared_ptr<AlertLayerHandler::SegmentRecord>& segmentRecord); | ||||
|    void ConnectAlertHandlerSignals(); | ||||
|    void ConnectSignals(); | ||||
|    void HandleGeoLinesEvent(std::shared_ptr<gl::draw::GeoLineDrawItem>& di, | ||||
|    void HandleGeoLinesEvent(std::weak_ptr<gl::draw::GeoLineDrawItem>& di, | ||||
|                             QEvent*                                   ev); | ||||
|    void HandleGeoLinesHover(std::shared_ptr<gl::draw::GeoLineDrawItem>& di, | ||||
|                             const QPointF& mouseGlobalPos); | ||||
|  | @ -633,11 +633,12 @@ void AlertLayer::Impl::AddLine(std::shared_ptr<gl::draw::GeoLines>& geoLines, | |||
|                    std::placeholders::_1, | ||||
|                    std::placeholders::_2)); | ||||
| 
 | ||||
|       std::weak_ptr<gl::draw::GeoLineDrawItem> diWeak = di; | ||||
|       gl::draw::GeoLines::RegisterEventHandler( | ||||
|          di, | ||||
|          std::bind(&AlertLayer::Impl::HandleGeoLinesEvent, | ||||
|                    this, | ||||
|                    di, | ||||
|                    diWeak, | ||||
|                    std::placeholders::_1)); | ||||
|    } | ||||
| } | ||||
|  | @ -691,8 +692,14 @@ void AlertLayer::Impl::UpdateLines() | |||
| } | ||||
| 
 | ||||
| void AlertLayer::Impl::HandleGeoLinesEvent( | ||||
|    std::shared_ptr<gl::draw::GeoLineDrawItem>& di, QEvent* ev) | ||||
|    std::weak_ptr<gl::draw::GeoLineDrawItem>& diWeak, QEvent* ev) | ||||
| { | ||||
|    std::shared_ptr<gl::draw::GeoLineDrawItem> di = diWeak.lock(); | ||||
|    if (di == nullptr) | ||||
|    { | ||||
|       return; | ||||
|    } | ||||
| 
 | ||||
|    switch (ev->type()) | ||||
|    { | ||||
|    case QEvent::Type::MouseButtonPress: | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 AdenKoperczak
						AdenKoperczak