mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-14 18:27:58 -06:00
Fixed a GCode preview crash on Linux due to returning a reference to temporary (issue #872)
This commit is contained in:
parent
9af6a89f20
commit
d89f8128cd
3 changed files with 3 additions and 5 deletions
|
@ -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)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue