bugfix [#24671] Operators called from Python Leak Memory

This problem is caused by returning Modal from a non-modal operator.
This commit is contained in:
Campbell Barton
2010-11-17 12:32:39 +00:00
parent 673ed8b50d
commit 376d129dc6

View File

@@ -1439,13 +1439,16 @@ class VIEW3D_OT_edit_mesh_extrude_individual_move(bpy.types.Operator):
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,11 +1467,14 @@ class VIEW3D_OT_edit_mesh_extrude_move(bpy.types.Operator):
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)