Skip to content

Commit 58a0caa

Browse files
author
wonder
committed
Better cleanup of resources when unloading plugins
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@13773 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent 4376e77 commit 58a0caa

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

python/utils.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -216,11 +216,11 @@ def _unloadPluginModules(packageName):
216216
# if it looks like a Qt resource file, try to do a cleanup
217217
# otherwise we might experience a segfault next time the plugin is loaded
218218
# because Qt will try to access invalid plugin resource data
219-
if "resources" in mod:
220-
try:
221-
sys.modules[mod].qCleanupResources()
222-
except:
223-
pass
219+
try:
220+
if hasattr(sys.modules[mod], 'qCleanupResources'):
221+
sys.modules[mod].qCleanupResources()
222+
except:
223+
pass
224224
# try to remove the module from python
225225
try:
226226
del sys.modules[mod]

0 commit comments

Comments
 (0)