mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-05-18 02:52:10 +00:00
Fixed a GCode preview crash on Linux due to returning a reference to temporary (issue #872)
This commit is contained in:
@@ -2204,7 +2204,7 @@ void _3DScene::_load_gcode_extrusion_paths(const GCodePreviewData& preview_data,
|
||||
return 0.0f;
|
||||
}
|
||||
|
||||
static const GCodePreviewData::Color& path_color(const GCodePreviewData& data, const std::vector<float>& tool_colors, float value)
|
||||
static const GCodePreviewData::Color path_color(const GCodePreviewData& data, const std::vector<float>& tool_colors, float value)
|
||||
{
|
||||
switch (data.extrusion.view_type)
|
||||
{
|
||||
@@ -2257,7 +2257,6 @@ void _3DScene::_load_gcode_extrusion_paths(const GCodePreviewData& preview_data,
|
||||
};
|
||||
|
||||
typedef std::vector<Filter> FiltersList;
|
||||
|
||||
size_t initial_volumes_count = volumes.volumes.size();
|
||||
|
||||
// detects filters
|
||||
@@ -2281,7 +2280,6 @@ void _3DScene::_load_gcode_extrusion_paths(const GCodePreviewData& preview_data,
|
||||
for (Filter& filter : filters)
|
||||
{
|
||||
s_gcode_preview_volume_index.first_volumes.emplace_back(GCodePreviewVolumeIndex::Extrusion, (unsigned int)filter.role, (unsigned int)volumes.volumes.size());
|
||||
|
||||
GLVolume* volume = new GLVolume(Helper::path_color(preview_data, tool_colors, filter.value).rgba);
|
||||
if (volume != nullptr)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user