mirror of
				https://github.com/subsurface/subsurface.git
				synced 2025-02-19 22:16:15 +00:00 
			
		
		
		
	Planner: make sure stagingDive is reset to NULL
If we first ADD a dive and then PLAN a dive, stagingDive first was an alias to the current_dive (for ADD) - we need to make sure that when PLAN is started, a new dive is allocated. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
		
							parent
							
								
									6576790ff6
								
							
						
					
					
						commit
						ff7bff48b8
					
				
					 1 changed files with 4 additions and 3 deletions
				
			
		|  | @ -316,6 +316,8 @@ void DivePlannerWidget::decoSacChanged(const QString &decosac) | |||
| void DivePlannerPointsModel::setPlanMode(Mode m) | ||||
| { | ||||
| 	mode = m; | ||||
| 	if (m == NOTHING) | ||||
| 		stagingDive = NULL; | ||||
| } | ||||
| 
 | ||||
| bool DivePlannerPointsModel::isPlanner() | ||||
|  | @ -671,10 +673,9 @@ void DivePlannerPointsModel::cancelPlan() | |||
| 		} | ||||
| 	} | ||||
| 
 | ||||
| 	if (mode != ADD) { | ||||
| 	if (mode != ADD) // for ADD stagingDive points at current_dive
 | ||||
| 		free(stagingDive); | ||||
| 		stagingDive = NULL; | ||||
| 	} | ||||
| 	stagingDive = NULL; // always reset the stagingDive to NULL
 | ||||
| 	setPlanMode(NOTHING); | ||||
| 	diveplan.dp = NULL; | ||||
| 	emit planCanceled(); | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue