fix: file handler not properly closed

This commit is contained in:
Swann 2020-09-28 22:51:07 +02:00
parent cb836e30f5
commit e466f81600
No known key found for this signature in database
GPG Key ID: E1D3641A7C43AACB

View File

@ -239,6 +239,11 @@ class SessionStartOperator(bpy.types.Operator):
bpy.app.handlers.depsgraph_update_post.remove( bpy.app.handlers.depsgraph_update_post.remove(
depsgraph_evaluation) depsgraph_evaluation)
logger = logging.getLogger()
for handler in logger.handlers:
if isinstance(handler, logging.FileHandler):
logger.removeHandler(handler)
bpy.ops.session.apply_armature_operator() bpy.ops.session.apply_armature_operator()
self.report( self.report(
@ -305,12 +310,6 @@ class SessionStopOperator(bpy.types.Operator):
try: try:
client.disconnect() client.disconnect()
logger = logging.getLogger()
for handler in logger.handlers:
if isinstance(handler, logging.FileHandler):
logger.removeHandler(handler)
except Exception as e: except Exception as e:
self.report({'ERROR'}, repr(e)) self.report({'ERROR'}, repr(e))
else: else: