Skip to content

Model corruption and crash after removing definition under certain conditions #75

@Eneroth3

Description

@Eneroth3

This one has been hunting my code for some time now and has been really hard to track down.

Steps to reproduce:

  1. Open model containing a component, e.g. Architectural Template with Stacy.

  2. Run this code:

    model = Sketchup.active_model
    definition = model.definitions.first
    model.start_operation("Reload", true)
    definition.entities.add_cpoint(ORIGIN)
    definition.parent.remove(definition)
    model.commit_operation
    Sketchup.undo # Can be replaced by unduoing from UI.

  3. Trigger bugsplat by any of the following:
    a. Load component from component browser
    b. Create new component in model
    c. Run Fix Problems (Model Info > Statistics > Fix Problems)
    d. Save model

The crash can be prevented by doing any of the following:

  1. Not use a wrapping operation
  2. Not create the CPoint
  3. Not call undo (or by redo the undo)

This bug was found when trying to make a workaround for #50.

New on SU2018 (DefinitionList.remove was added in 2018). Tested on Win 7.
Bugsplats have been reported by Eneroth3 on 2018-03-26.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions