File tree Expand file tree Collapse file tree 2 files changed +8
-0
lines changed Expand file tree Collapse file tree 2 files changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -1037,6 +1037,7 @@ macro_rules! shared_app_impl {
10371037 for ( _, webview) in self . manager. webviews( ) {
10381038 webview. resources_table( ) . clear( ) ;
10391039 }
1040+ unsafe { self . manager. state. clear( ) } ;
10401041 }
10411042
10421043 /// Gets the invoke key that must be referenced when using [`crate::webview::InvokeRequest`].
Original file line number Diff line number Diff line change @@ -149,6 +149,13 @@ impl StateManager {
149149 Some ( * value)
150150 }
151151
152+ /// SAFETY: This will cause all references obtained through [Self::try_get] to dangle.
153+ /// This must only be called on app exit (in cleanup_before_exit).
154+ pub ( crate ) unsafe fn clear ( & self ) {
155+ let mut map = self . map . lock ( ) . unwrap ( ) ;
156+ map. clear ( ) ;
157+ }
158+
152159 /// Gets the state associated with the specified type.
153160 pub fn get < T : Send + Sync + ' static > ( & self ) -> State < ' _ , T > {
154161 self
You can’t perform that action at this time.
0 commit comments