mirror of
https://github.com/qgis/QGIS.git
synced 2025-02-25 00:58:06 -05:00
Better cleanup of resources when unloading plugins
git-svn-id: http://svn.osgeo.org/qgis/trunk@13773 c8812cc2-4d05-0410-92ff-de0c093fc19c
This commit is contained in:
parent
e24d11f430
commit
9d1d81e18f
@ -216,11 +216,11 @@ def _unloadPluginModules(packageName):
|
||||
# if it looks like a Qt resource file, try to do a cleanup
|
||||
# otherwise we might experience a segfault next time the plugin is loaded
|
||||
# because Qt will try to access invalid plugin resource data
|
||||
if "resources" in mod:
|
||||
try:
|
||||
sys.modules[mod].qCleanupResources()
|
||||
except:
|
||||
pass
|
||||
try:
|
||||
if hasattr(sys.modules[mod], 'qCleanupResources'):
|
||||
sys.modules[mod].qCleanupResources()
|
||||
except:
|
||||
pass
|
||||
# try to remove the module from python
|
||||
try:
|
||||
del sys.modules[mod]
|
||||
|
Loading…
x
Reference in New Issue
Block a user