Conversation
…ete. GCodeViewer::load_shells() removed modifiers with a bare delete, leaving dangling GLVolume* entries in g_meshVolumesMap. Port of Snapmaker/OrcaSlicer Snapmaker#844. Co-authored-by: aceRage <aceRage@users.noreply.github.com>
Owner
Author
|
Closing: the patch calls release_volume() and references g_meshVolumesMap, neither of which exists in this fork's GUI code, so it cannot compile as-is (review 2026-09-19). Reopen against the current LOD code if the dangling-volume case still reproduces. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Port of Snapmaker/OrcaSlicer #844 (merged).
GCodeViewer::load_shells()removes modifier volumes with a baredelete, but those volumes were already registered into the global LOD sharing map (g_meshVolumesMap) byload_object_volume(). Deleting them without callingrelease_volume()leaves danglingGLVolume*entries in the map.When the same mesh is loaded again (for example switching back to a sliced plate),
load_object_volume()can pick up the stale pointer asfirstVolumeand copy itsshared_ptr<GLModel>LOD models, crashing inshared_ptr::operator=(use-after-free).This change calls
GLVolumeCollection::release_volume()beforedelete, matching the existing paths inclear()and the GLCanvas3D reload (P0-2) on Snapmaker/OrcaSlicer.Only the modifier-removal loop in
src/slic3r/GUI/GCodeViewer.cppis touched.Screenshots/Recordings/Graphs
N/A — no UI change.
Tests
maindoes not yet declareGLVolumeCollection::release_volume()org_meshVolumesMap(LOD sharing from Snapmaker). This PR is the exact fix: unregister shell volumes from LOD sharing map before delete in l… Snapmaker/OrcaSlicer#844 site port and will compile once that API is present. Left as draft and not merged.