File tree Expand file tree Collapse file tree
data/shared/citizen/scripting Expand file tree Collapse file tree Original file line number Diff line number Diff line change 655655
656656-- Remove cache when resource stop to avoid calling unexisting exports
657657local function lazyEventHandler () -- lazy initializer so we don't add an event we don't need
658- AddEventHandler ((' on%sResourceStop' ):format (isDuplicityVersion and ' Server' or ' Client' ), function (resource )
658+ -- Use onResourceStop to not break cached exports for onResourceStart
659+ AddEventHandler (' onResourceStop' , function (resource )
659660 exportsCallbackCache [resource ] = {}
660661 end )
661662
Original file line number Diff line number Diff line change @@ -568,7 +568,8 @@ const EXT_LOCALFUNCREF = 11;
568568 }
569569 } ) ;
570570
571- on ( `on${ eventType } ResourceStop` , ( resource ) => {
571+ // clear cache with onResourceStop to not break cached exports for onResourceStart
572+ on ( 'onResourceStop' , ( resource ) => {
572573 exportsCallbackCache [ resource ] = { } ;
573574 } ) ;
574575
You can’t perform that action at this time.
0 commit comments