[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [33129] trunk/blender/release/scripts/ui/ space_view3d.py: bugfix [#24671] Operators called from Python Leak Memory

Campbell Barton ideasman42 at gmail.com
Wed Nov 17 13:32:39 CET 2010


Revision: 33129
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=33129
Author:   campbellbarton
Date:     2010-11-17 13:32:39 +0100 (Wed, 17 Nov 2010)

Log Message:
-----------
bugfix [#24671] Operators called from Python Leak Memory
This problem is caused by returning Modal from a non-modal operator.

Modified Paths:
--------------
    trunk/blender/release/scripts/ui/space_view3d.py

Modified: trunk/blender/release/scripts/ui/space_view3d.py
===================================================================
--- trunk/blender/release/scripts/ui/space_view3d.py	2010-11-17 12:16:34 UTC (rev 33128)
+++ trunk/blender/release/scripts/ui/space_view3d.py	2010-11-17 12:32:39 UTC (rev 33129)
@@ -1439,14 +1439,17 @@
         totvert = mesh.total_vert_sel
 
         if select_mode[2] and totface == 1:
-            return bpy.ops.mesh.extrude_region_move('INVOKE_REGION_WIN', TRANSFORM_OT_translate={"constraint_orientation": 'NORMAL', "constraint_axis": (False, False, True)})
+            bpy.ops.mesh.extrude_region_move('INVOKE_REGION_WIN', TRANSFORM_OT_translate={"constraint_orientation": 'NORMAL', "constraint_axis": (False, False, True)})
         elif select_mode[2] and totface > 1:
-            return bpy.ops.mesh.extrude_faces_move('INVOKE_REGION_WIN')
+            bpy.ops.mesh.extrude_faces_move('INVOKE_REGION_WIN')
         elif select_mode[1] and totedge >= 1:
-            return bpy.ops.mesh.extrude_edges_move('INVOKE_REGION_WIN')
+            bpy.ops.mesh.extrude_edges_move('INVOKE_REGION_WIN')
         else:
-            return bpy.ops.mesh.extrude_vertices_move('INVOKE_REGION_WIN')
+            bpy.ops.mesh.extrude_vertices_move('INVOKE_REGION_WIN')
 
+        # ignore return from operators above because they are 'RUNNING_MODAL', and cause this one not to be freed. [#24671]
+        return {'FINISHED'}
+
     def invoke(self, context, event):
         return self.execute(context)
 
@@ -1464,12 +1467,15 @@
         totvert = mesh.total_vert_sel
 
         if totface >= 1:
-            return bpy.ops.mesh.extrude_region_move('INVOKE_REGION_WIN', TRANSFORM_OT_translate={"constraint_orientation": 'NORMAL', "constraint_axis": (False, False, True)})
+            bpy.ops.mesh.extrude_region_move('INVOKE_REGION_WIN', TRANSFORM_OT_translate={"constraint_orientation": 'NORMAL', "constraint_axis": (False, False, True)})
         elif totedge == 1:
-            return bpy.ops.mesh.extrude_region_move('INVOKE_REGION_WIN', TRANSFORM_OT_translate={"constraint_orientation": 'NORMAL', "constraint_axis": (True, True, False)})
+            bpy.ops.mesh.extrude_region_move('INVOKE_REGION_WIN', TRANSFORM_OT_translate={"constraint_orientation": 'NORMAL', "constraint_axis": (True, True, False)})
         else:
-            return bpy.ops.mesh.extrude_region_move('INVOKE_REGION_WIN')
+            bpy.ops.mesh.extrude_region_move('INVOKE_REGION_WIN')
 
+        # ignore return from operators above because they are 'RUNNING_MODAL', and cause this one not to be freed. [#24671]
+        return {'FINISHED'}
+
     def invoke(self, context, event):
         return self.execute(context)
 





More information about the Bf-blender-cvs mailing list