File tree Expand file tree Collapse file tree 1 file changed +12
-2
lines changed
panda/python/core/pandare Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -744,13 +744,23 @@ def unload_plugin(self, name):
744
744
self .libpanda .panda_unload_plugin_by_name (name_ffi )
745
745
746
746
def _unload_pyplugins (self ):
747
+ '''
748
+ Unload Python plugins first.
749
+
750
+ We have to be careful to not remove __main_loop_wait because we're executing inside of __main_loop_wait and it more work to do
751
+
752
+ We achieve this by first popping main loop wait and then re-adding it after unloading all other callbacks
753
+ '''
754
+ mlw = self .registered_callbacks .pop ("__main_loop_wait" )
755
+
747
756
# First unload python plugins, should be safe to do anytime
748
- while len ( list ( self .registered_callbacks )) > 0 :
757
+ while self .registered_callbacks :
749
758
try :
750
759
self .delete_callback (list (self .registered_callbacks .keys ())[0 ])
751
760
except IndexError :
752
761
continue
753
- #self.disable_callback(name)
762
+
763
+ self .registered_callbacks ["__main_loop_wait" ] = mlw
754
764
755
765
# Next, unload any pyplugins
756
766
if hasattr (self , "_pyplugin_manager" ):
You can’t perform that action at this time.
0 commit comments