mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-06 22:47:29 -06:00
Force garbage collection during ProcessSlicedLayersJob
For some reason, Python likes to hold on to LayerData and friends. Forcing a GC run here will clean them up properly. Contributes to CURA-2406
This commit is contained in:
parent
8e5183bad4
commit
baa24370f6
1 changed files with 8 additions and 0 deletions
|
@ -1,6 +1,8 @@
|
|||
# Copyright (c) 2016 Ultimaker B.V.
|
||||
# Cura is released under the terms of the AGPLv3 or higher.
|
||||
|
||||
import gc
|
||||
|
||||
from UM.Job import Job
|
||||
from UM.Scene.Iterator.DepthFirstIterator import DepthFirstIterator
|
||||
from UM.Scene.SceneNode import SceneNode
|
||||
|
@ -64,6 +66,12 @@ class ProcessSlicedLayersJob(Job):
|
|||
self._progress.hide()
|
||||
return
|
||||
|
||||
# Force garbage collection.
|
||||
# For some reason, Python has a tendency to keep the layer data
|
||||
# in memory longer than needed. Forcing the GC to run here makes
|
||||
# sure any old layer data is really cleaned up before adding new.
|
||||
gc.collect()
|
||||
|
||||
mesh = MeshData()
|
||||
layer_data = LayerDataBuilder.LayerDataBuilder()
|
||||
layer_count = len(self._layers)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue