[Bf-blender-cvs] [0983692] ui-preview-buttons: workaround for complain on non-closed previews on exit
Campbell Barton
noreply at git.blender.org
Mon May 11 15:39:32 CEST 2015
Commit: 09836924419b877c42cf9615a74bf3bcd54046a2
Author: Campbell Barton
Date: Mon May 11 23:39:01 2015 +1000
Branches: ui-preview-buttons
https://developer.blender.org/rB09836924419b877c42cf9615a74bf3bcd54046a2
workaround for complain on non-closed previews on exit
===================================================================
M release/scripts/modules/bpy/utils/previews.py
===================================================================
diff --git a/release/scripts/modules/bpy/utils/previews.py b/release/scripts/modules/bpy/utils/previews.py
index e901e24..d4846f6 100644
--- a/release/scripts/modules/bpy/utils/previews.py
+++ b/release/scripts/modules/bpy/utils/previews.py
@@ -126,3 +126,12 @@ def remove(p):
"""
p.close()
+
+# don't complain about resources on exit (only unregister)
+import atexit
+
+def exit_clear_warning():
+ del _BPyImagePreviewCollection.__del__
+
+atexit.register(exit_clear_warning)
+del atexit, exit_clear_warning
More information about the Bf-blender-cvs
mailing list