File tree Expand file tree Collapse file tree 2 files changed +7
-0
lines changed 
packages/svelte/src/internal/client/dom/elements Expand file tree Collapse file tree 2 files changed +7
-0
lines changed Original file line number Diff line number Diff line change 1+ --- 
2+ ' svelte '  : patch 
3+ --- 
4+ 
5+ fix: nullify ` last_propagated_event `  to avoid memory leak
Original file line number Diff line number Diff line change @@ -146,6 +146,7 @@ export function delegate(events) {
146146// If the event object is GCed too early, the expando __root property 
147147// set on the event object is lost, causing the event delegation 
148148// to process the event twice 
149+ /** @type  {Event | null } */ 
149150let  last_propagated_event  =  null ; 
150151
151152/** 
@@ -182,6 +183,7 @@ export function handle_event_propagation(event) {
182183			// chain in case someone manually dispatches the same event object again. 
183184			// @ts -expect-error 
184185			event . __root  =  handler_element ; 
186+ 			last_propagated_event  =  null ; 
185187			return ; 
186188		} 
187189
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments