Skip to content

Fix crash when importing image to empty frame on hidden layer#1820

Merged
MrStevns merged 5 commits into
pencil2d:masterfrom
J5lx:fixes/hidden-layer-import
Apr 14, 2024
Merged

Fix crash when importing image to empty frame on hidden layer#1820
MrStevns merged 5 commits into
pencil2d:masterfrom
J5lx:fixes/hidden-layer-import

Conversation

@J5lx
Copy link
Copy Markdown
Member

@J5lx J5lx commented Apr 13, 2024

This fixes the crash reported at https://discuss.pencil2d.org/t/pencil2d-crashes-when-i-import-an-image-to-a-hidden-layer/8016?u=j5lx.

  • Also fixed a potential memory leak in Layer::addNewKeyFrameAt
  • Also disabled timeline hover effect for hidden layers since double-click-to-add-keyframe is disabled for those
  • Also implicitly fixed an issue where trying to import to hidden layers showed a warning for empty frames but not on keyframes

@J5lx J5lx added Bug Timeline UI Related to the visual appearance of the program Crash File Import labels Apr 13, 2024
@J5lx J5lx added this to the v0.6.7 milestone Apr 13, 2024
* @return The newly created keyframe or `nullptr` if the layer is not visible
* @see Editor::addNewKey()
*/
KeyFrame* addKeyFrame(int layerNumber, int frameIndex);
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

second parameter renamed so declaration matches definition

Copy link
Copy Markdown
Member

@MrStevns MrStevns left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Crash confirmed fixed.

Additional changes looks good to me too 👍

@MrStevns MrStevns merged commit 37cbd97 into pencil2d:master Apr 14, 2024
@J5lx J5lx deleted the fixes/hidden-layer-import branch July 2, 2024 02:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Crash File Import Timeline UI Related to the visual appearance of the program

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

2 participants