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:
wonder 2010-06-21 22:26:36 +00:00
parent e24d11f430
commit 9d1d81e18f

View File

@ -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]