From 4c527776e7a812660d125ae83c5bf9c2cb323f8e Mon Sep 17 00:00:00 2001 From: Enrico Turri Date: Tue, 23 Oct 2018 11:44:46 +0200 Subject: [PATCH 1/2] Fixed memory leak in Tab::add_options_page() --- src/slic3r/GUI/Tab.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/slic3r/GUI/Tab.cpp b/src/slic3r/GUI/Tab.cpp index 55aeaa234..1897b4779 100644 --- a/src/slic3r/GUI/Tab.cpp +++ b/src/slic3r/GUI/Tab.cpp @@ -234,9 +234,9 @@ Slic3r::GUI::PageShp Tab::add_options_page(const wxString& title, const std::str icon_idx = (m_icon_index.find(icon) == m_icon_index.end()) ? -1 : m_icon_index.at(icon); if (icon_idx == -1) { // Add a new icon to the icon list. - const auto img_icon = new wxIcon(from_u8(Slic3r::var(icon)), wxBITMAP_TYPE_PNG); - m_icons->Add(*img_icon); - icon_idx = ++m_icon_count; + wxIcon img_icon(from_u8(Slic3r::var(icon)), wxBITMAP_TYPE_PNG); + m_icons->Add(img_icon); + icon_idx = ++m_icon_count; m_icon_index[icon] = icon_idx; } } From 9a4a41acbfe5dc44d51a0918f3eeabd1c4b45f0b Mon Sep 17 00:00:00 2001 From: Enrico Turri Date: Tue, 23 Oct 2018 11:50:30 +0200 Subject: [PATCH 2/2] New selection -> Fixed selection cleanup in GLCanvas3D::reset_volumes() --- src/slic3r/GUI/GLCanvas3D.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/slic3r/GUI/GLCanvas3D.cpp b/src/slic3r/GUI/GLCanvas3D.cpp index 7d47ff8f6..5db94b95f 100644 --- a/src/slic3r/GUI/GLCanvas3D.cpp +++ b/src/slic3r/GUI/GLCanvas3D.cpp @@ -2893,11 +2893,11 @@ void GLCanvas3D::reset_volumes() return; #endif // !ENABLE_USE_UNIQUE_GLCONTEXT - m_volumes.release_geometry(); - m_volumes.clear(); #if ENABLE_EXTENDED_SELECTION m_selection.clear(); #endif // ENABLE_EXTENDED_SELECTION + m_volumes.release_geometry(); + m_volumes.clear(); m_dirty = true; }