Sometimes when developing an extension, it breaks something. Then, it is not possible to unload the extension (e.g. I can still see my custom UI buttons). The console shows the image that continuously prints this error. I know it came from this one update subscriber function, so I commented out the subscriber, but the error still showed. Then, I even commented out the function itself, and again the error shows an error on lines that are not even active. So, its not reloading.
The script is definitely not the problem, because I don’t change the script at all, close kit, relaunch it, and then open the extension again and it works.
*update: question remains, but I found that there is an issue with how the
_on_update function gets overridden when using
self._update_sub = omni.kit.app.get_app().get_update_event_stream().create_subscription_to_pop( self._on_update, name="omni.physx demo update hack" ).
I noticed that, for example, if I add a print statement in
self._on_update, it will print to the console. However, if I change the data that is printing, it adds that print statement instead of replacing it. So it seems like there is something that is appending the function that is changed, instead of replacing it.