You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is because one could make local import in unload function to access for example a global object. If the submodule with the global object is unloaded first, then a new global object is created.
Current behavior is inconsistent with manual reload (menuBar->Plugins->Manage and Install Plugins...->uncheck a plugin and then check it again) - I have no error when reloading plugin from QGIS.
Note: Why should one perform local import in initGui and unload methods in QGIS plugin instead of global import?
Because submodules should only be loaded if the plugin is active.
It is especially severe, when a submodule have long load time (ex. fetching data from DB) and despite plugin been disabled, it still impacts QGIS startup time.
The text was updated successfully, but these errors were encountered:
I believe that this code:
plugin_reloader/reloader_plugin.py
Lines 262 to 267 in 36ddcb2
should be executed after call to
unloadPlugin
method (but beforeloadPlugin
):plugin_reloader/reloader_plugin.py
Lines 273 to 276 in 36ddcb2
This is because one could make local import in
unload
function to access for example a global object. If the submodule with the global object is unloaded first, then a new global object is created.Current behavior is inconsistent with manual reload (menuBar->Plugins->Manage and Install Plugins...->uncheck a plugin and then check it again) - I have no error when reloading plugin from QGIS.
Note: Why should one perform local import in
initGui
andunload
methods in QGIS plugin instead of global import?Because submodules should only be loaded if the plugin is active.
It is especially severe, when a submodule have long load time (ex. fetching data from DB) and despite plugin been disabled, it still impacts QGIS startup time.
The text was updated successfully, but these errors were encountered: