Boolean Loop Crash

I wrote a script some days ago, a part of which you can see below.

bpy.ops.transform.translate(value=(0,0,-0.5))
nm2=actor1.modifiers.new(‘newmod2’,‘BOOLEAN’)
nm2.object=actor_dummy
nm2.operation=‘INTERSECT’
bpy.ops.object.modifier_apply(apply_as=‘DATA’, modifier=‘newmod2’)
bpy.ops.object.modifier_remove(modifier=‘newmod2’)

When i run this script inside a loop i get random crashes of blender. When i run it once at a time it runs smoothly. Does anyone have any ideas on the matter?

The modifier gets “removed” once it is applied. Try removing the modifier_remove call.