Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix some clones not getting removed when sprite is deleted #2358

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

apple502j
Copy link
Contributor

@apple502j apple502j commented May 7, 2020

Resolves

Resolves #2357

Proposed Changes

Fixes VM.deleteSprite by removing the first clone N times, rather than removing the clone using the index.

Reason for Changes

Previous code was like this:
image
Run it on Scratch and see what's wrong...

Test Coverage

Manually tested.

note: please review PR about another bug related to deletion and clone too: #2353

@ericrosenbaum
Copy link
Contributor

thanks @apple502j! Our process is currently that PRs will be reviewed after our team assigns a priority label to the corresponding issue. Thanks for your patience.

adroitwhiz added a commit to adroitwhiz/scratch-vm that referenced this pull request Mar 19, 2023
This cleans up the code around sprite deletion and disposal:

- All clones are now disposed of when a sprite is deleted. A previous
bug (scratchfoundation#2358) was causing only half
the clones to be disposed.

- deleteMonitors has been moved from Runtime.dispose into
RenderedTarget.dispose.

- RenderedTarget.dispose now calls its superclass method Target.dispose
before disposing itself, which removes the need to call
removeExecutable itself. Target.dispose is no longer marked abstract as
a result.

These changes were motivated by a desire to rework monitor cleanup and
deletion, which are part of a larger refactor of monitor blocks to
help implement target-specific monitors for extensions.
adroitwhiz added a commit to adroitwhiz/scratch-vm that referenced this pull request Jun 16, 2024
This cleans up the code around sprite deletion and disposal:

- All clones are now disposed of when a sprite is deleted. A previous
bug (scratchfoundation#2358) was causing only half
the clones to be disposed.

- deleteMonitors has been moved from Runtime.dispose into
RenderedTarget.dispose.

- RenderedTarget.dispose now calls its superclass method Target.dispose
before disposing itself, which removes the need to call
removeExecutable itself. Target.dispose is no longer marked abstract as
a result.

These changes were motivated by a desire to rework monitor cleanup and
deletion, which are part of a larger refactor of monitor blocks to
help implement target-specific monitors for extensions.
adroitwhiz added a commit to adroitwhiz/scratch-vm that referenced this pull request Jun 18, 2024
This cleans up the code around sprite deletion and disposal:

- All clones are now disposed of when a sprite is deleted. A previous
bug (scratchfoundation#2358) was causing only half
the clones to be disposed.

- deleteMonitors has been moved from Runtime.dispose into
RenderedTarget.dispose.

- RenderedTarget.dispose now calls its superclass method Target.dispose
before disposing itself, which removes the need to call
removeExecutable itself. Target.dispose is no longer marked abstract as
a result.

These changes were motivated by a desire to rework monitor cleanup and
deletion, which are part of a larger refactor of monitor blocks to
help implement target-specific monitors for extensions.
adroitwhiz added a commit to adroitwhiz/scratch-vm that referenced this pull request Jun 19, 2024
This cleans up the code around sprite deletion and disposal:

- All clones are now disposed of when a sprite is deleted. A previous
bug (scratchfoundation#2358) was causing only half
the clones to be disposed.

- deleteMonitors has been moved from Runtime.dispose into
RenderedTarget.dispose.

- RenderedTarget.dispose now calls its superclass method Target.dispose
before disposing itself, which removes the need to call
removeExecutable itself. Target.dispose is no longer marked abstract as
a result.

These changes were motivated by a desire to rework monitor cleanup and
deletion, which are part of a larger refactor of monitor blocks to
help implement target-specific monitors for extensions.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Clones are not properly deleted when deleting sprite
2 participants