Fixes a memory leak in dropdown menus. PNG saving is fine, loading gives an error but it seems to be some internal stuff
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@649 416bcca6-2ee7-4201-b75f-2eb2f807beb1
This commit is contained in:
		
							parent
							
								
									6b856384eb
								
							
						
					
					
						commit
						0ce264aa3b
					
				
							
								
								
									
										11
									
								
								moteur.c
									
									
									
									
									
								
							
							
						
						
									
										11
									
								
								moteur.c
									
									
									
									
									
								
							@ -1160,6 +1160,7 @@ void Fermer_fenetre(void)
 | 
			
		||||
  struct Fenetre_Bouton_scroller * Temp3;
 | 
			
		||||
  struct Fenetre_Bouton_special  * Temp4;
 | 
			
		||||
  struct Fenetre_Bouton_dropdown * Temp5;
 | 
			
		||||
  struct Bouton_dropdown_choix   * Temp6;
 | 
			
		||||
 | 
			
		||||
  Effacer_curseur();
 | 
			
		||||
 | 
			
		||||
@ -1190,6 +1191,15 @@ void Fermer_fenetre(void)
 | 
			
		||||
  while (Fenetre_Liste_boutons_dropdown)
 | 
			
		||||
  {
 | 
			
		||||
    Temp5=Fenetre_Liste_boutons_dropdown->Next;
 | 
			
		||||
 | 
			
		||||
    // Il faut libérer la liste des boutons qui sont dans le dropdown
 | 
			
		||||
    while (Fenetre_Liste_boutons_dropdown->Premier_choix)
 | 
			
		||||
    {
 | 
			
		||||
        Temp6 = Fenetre_Liste_boutons_dropdown->Premier_choix->Next;
 | 
			
		||||
        free(Fenetre_Liste_boutons_dropdown->Premier_choix);
 | 
			
		||||
        Fenetre_Liste_boutons_dropdown->Premier_choix = Temp6;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    free(Fenetre_Liste_boutons_dropdown);
 | 
			
		||||
    Fenetre_Liste_boutons_dropdown=Temp5;
 | 
			
		||||
  }
 | 
			
		||||
@ -1607,6 +1617,7 @@ void Fenetre_Dropdown_choix(struct Fenetre_Bouton_dropdown * Dropdown, word Nume
 | 
			
		||||
  Dernier=Dropdown->Premier_choix;
 | 
			
		||||
  if (Dernier)
 | 
			
		||||
  {
 | 
			
		||||
    // On cherche le dernier élément
 | 
			
		||||
    for (;Dernier->Next;Dernier=Dernier->Next)
 | 
			
		||||
      ;
 | 
			
		||||
    Dernier->Next=Temp;
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user