public void finalize() { if (!gcode.isOpened()) { return; } gcode.finalize(maxObjectHeight, config.travelSpeed, config.endCode); gcode.Close(); }