Skip to content

Commit

Permalink
Better cleanup of resources when unloading plugins
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@13773 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
wonder committed Jun 21, 2010
1 parent 4376e77 commit 58a0caa
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions python/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down

0 comments on commit 58a0caa

Please sign in to comment.