Digital-Logic-Sim icon indicating copy to clipboard operation
Digital-Logic-Sim copied to clipboard

[Bug] Saving a copy of a chip that's in use corrupts the project until reload

Open JC3 opened this issue 2 years ago • 1 comments

When a chip is in use in another circuit, editing that chip then saving a copy of it corrupts the project until the project is reloaded. It leads to blackened, unusable wires in the affected circuits, and also failure of the library dialog to close upon pressing "edit".

Video:

https://www.youtube.com/watch?v=jIltbzoHrA4

Steps to reproduce:

  1. Create a circuit with at least one chip in it (e.g. two NOT gates is sufficient), with input and output pins connected.
  2. Save that circuit.
  3. Create a new circuit and use the circuit from step 1-2 in it. Connect input and output pins.
  4. Save that circuit.
  5. From the LIBRARY, select the circuit from step 1-2 and edit it.
  6. Delete one of the chips, input pins, and output pins from the circuit.
  7. Save a copy of it as a different name.
  8. From the LIBRARY, select the circuit from step 3-4 and edit it.

Expected: Circuit from step 3-4 should still be functional, and saving a copy of the subcircuit should not have affected the original subcircuit. Also, expect LIBRARY dialog to close when EDIT button is pressed.

Actual: LIBRARY dialog does not close when EDIT button is pressed, it must be closed manually after pressing EDIT. More importantly, the circuit from step 3-4 will now have a bunch of blackened, frozen wires. These wires will not be functional and sometimes can not even be deleted. Moreover, if you open the circuit from step 1-2 again for editing, it will also be corrupt. The copy of it from step 5-7, however, will be fine.

Closing the project then loading it again will resolve the issues and the circuits will all become functional again.

Note that steps 3-4 are required: This issue will not occur if the copied chip is not in use in another circuit.

JC3 avatar Feb 26 '23 04:02 JC3

Hi, thanks for the detailed description! I'll look into this soon.

SebLague avatar Feb 26 '23 08:02 SebLague